Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
983 B
CMake
Raw Permalink Normal View History

2020-04-25 00:51:14 -04:00
cmake_minimum_required(VERSION 3.16)
2024-05-25 13:15:10 +02:00
cmake_policy(SET CMP0144 NEW)
project(plugin_python CXX)
2024-07-09 20:42:56 +02:00
set(Python_FIND_VIRTUALENV STANDARD)
2024-07-09 20:42:56 +02:00
# find Python before include mo2-cmake, otherwise this will trigger a bunch of CMP0111
# due to the imported configuration mapping variables defined in mo2.cmake
find_package(Python ${MO2_PYTHON_VERSION} COMPONENTS Interpreter Development REQUIRED)
find_package(pybind11 CONFIG REQUIRED)
2022-04-21 23:57:05 +02:00
2024-07-09 20:42:56 +02:00
find_package(mo2-cmake CONFIG REQUIRED)
get_filename_component(Python_HOME ${Python_EXECUTABLE} PATH)
set(Python_DLL_DIR "${Python_HOME}/DLLs")
set(Python_LIB_DIR "${Python_HOME}/Lib")
mo2_python_install_pyqt()
2024-05-25 13:15:10 +02:00
# useful for naming DLL, zip, etc. (3.10 -> 310)
set(Python_VERSION_SHORT ${Python_VERSION_MAJOR}${Python_VERSION_MINOR})
# projects
2022-05-06 08:31:10 +02:00
add_subdirectory(src)
2022-04-24 22:23:30 +02:00
# tests (if requested)
2024-07-09 20:42:56 +02:00
set(PLUGIN_PYTHON_TESTING ${BUILD_TESTING} CACHE BOOL "build tests for plugin_python")
if (PLUGIN_PYTHON_TESTING)
2022-05-02 18:56:44 +02:00
enable_testing()
2022-04-29 20:01:14 +02:00
add_subdirectory(tests)
endif()