@@ -2,44 +2,36 @@ cmake_minimum_required(VERSION 3.16)
22
33cmake_policy (SET CMP0144 NEW)
44
5- if (DEFINED DEPENDENCIES_DIR)
6- include (${DEPENDENCIES_DIR} /modorganizer_super/cmake_common/mo2.cmake)
7- else ()
8- include (${CMAKE_CURRENT_LIST_DIR} /../cmake_common/mo2.cmake)
9- endif ()
5+ # remove MinSizeRel otherwise CMP0111 breaks everything
6+ set (CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo" CACHE STRING "" FORCE)
107
118project (plugin_python CXX)
129
13- set (PYTHON_BUILD_PATH ${PYTHON_ROOT} /PCBuild/amd64 )
10+ find_package (mo2-cmake CONFIG REQUIRED )
1411
15- # find Python - lots of "Hints" since we have a weird setup
16- set (Python_USE_STATIC_LIBS False )
17- set (Python_INCLUDE_DIR ${PYTHON_ROOT} /Include )
18- set (Python_EXECUTABLE ${PYTHON_BUILD_PATH} /python.exe)
19- if (EXISTS "${PYTHON_BUILD_PATH} /python_d.exe" )
20- set (Python_EXECUTABLE ${PYTHON_BUILD_PATH} /python_d.exe)
21- endif ()
22- file (GLOB Python_LIBRARY ${PYTHON_BUILD_PATH} /python[0-9][0-9]*.lib)
23- find_package (Python COMPONENTS Interpreter Development REQUIRED)
12+ find_package (Python 3.12 COMPONENTS Interpreter Development REQUIRED)
13+ find_package (pybind11 CONFIG REQUIRED)
2414
25- # pybind11 needs uppercase (at least EXECUTABLE and LIBRARY)
26- set (PYTHON_EXECUTABLE ${Python_EXECUTABLE} )
27- set (PYTHON_INCLUDE_DIR ${Python_INCLUDE_DIR} )
28- set (PYTHON_LIBRARY ${Python_LIBRARY} )
15+ get_filename_component (Python_HOME ${Python_EXECUTABLE} PATH )
16+ set (Python_DLL_DIR "${Python_HOME} /DLLs" )
17+ set (Python_LIB_DIR "${Python_HOME} /Lib" )
18+
19+ add_custom_target (PyQt6)
20+ mo2_python_pip_install(PyQt6
21+ DIRECTORY ${CMAKE_BINARY_DIR} /pylibs/
22+ PACKAGES
23+ PyQt${Qt_VERSION_MAJOR} ==${Qt_VERSION}
24+ sip==6.8.5)
2925
3026# useful for naming DLL, zip, etc. (3.10 -> 310)
3127set (Python_VERSION_SHORT ${Python_VERSION_MAJOR}${Python_VERSION_MINOR} )
3228
33- # pybind11
34- add_subdirectory (${MO2_BUILD_PATH} /pybind11 ${CMAKE_CURRENT_BINARY_DIR} /pybind11)
35-
3629# projects
3730add_subdirectory (src)
38- set_property (DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT proxy)
3931
4032# tests (if requested)
41- set (PLUGIN_PYTHON_TESTS ${PLUGIN_PYTHON_TESTS } CACHE BOOL "build tests for plugin_python" )
42- if (PLUGIN_PYTHON_TESTS )
33+ set (PLUGIN_PYTHON_TESTING ${BUILD_TESTING } CACHE BOOL "build tests for plugin_python" )
34+ if (PLUGIN_PYTHON_TESTING )
4335 enable_testing ()
4436 add_subdirectory (tests)
4537endif ()
0 commit comments