diff --git a/CMakeLists.txt b/CMakeLists.txt index 47adb4511..7ee30d4cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -390,7 +390,7 @@ add_subdirectory(renderdoc) # are handled in common if(ENABLE_QRENDERDOC OR ENABLE_PYRENDERDOC) # Make sure Python 3 is found - set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7 3.8) + set(Python_ADDITIONAL_VERSIONS 3.8 3.7 3.6 3.5 3.4) find_package(PythonInterp 3 REQUIRED) find_package(PythonLibs 3 REQUIRED) # we also need python3-config for swig diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt index b72f96af8..77a998094 100644 --- a/qrenderdoc/CMakeLists.txt +++ b/qrenderdoc/CMakeLists.txt @@ -215,9 +215,17 @@ if(NOT BUILD_VERSION_DIST_CONTACT STREQUAL "") "DEFINES+=DISTRIBUTION_CONTACT='\\\\\"${BUILD_VERSION_DIST_CONTACT}\\\\\"'\n") endif() -if(PySide2_FOUND AND Shiboken2_FOUND) +option(QRENDERDOC_ENABLE_PYSIDE2 "Enable PySide2 if found" ON) + +if(NOT QRENDERDOC_ENABLE_PYSIDE2) + message(STATUS "PySide2 integration disabled") +elseif(PySide2_FOUND AND Shiboken2_FOUND) message(STATUS "Building with PySide2 ${PySide2_VERSION} from ${PySide2_DIR}") + if(NOT PYTHONLIBS_VERSION_STRING MATCHES "${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}") + message(FATAL_ERROR "Shiboken2 that we found was linked against python ${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR} but the python library we're linking against is ${PYTHONLIBS_VERSION_STRING}. Ensure these versions are identical or disable PySide2 compilation with QRENDERDOC_ENABLE_PYSIDE2.") + endif() + get_target_property(SHIBOKEN2_INCLUDE_DIRS Shiboken2::libshiboken INTERFACE_INCLUDE_DIRECTORIES) get_target_property(PYSIDE2_INCLUDE_DIRS PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES)