From e6c0ee16967d3aa79f645a5a0aad0d50c20987f4 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Sun, 20 Feb 2022 09:19:03 +0000 Subject: [PATCH] build: Only search for PySide2 if required --- qrenderdoc/CMakeLists.txt | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt index 05ad8ba89..e4470715e 100644 --- a/qrenderdoc/CMakeLists.txt +++ b/qrenderdoc/CMakeLists.txt @@ -154,9 +154,6 @@ ExternalProject_Add(custom_swig BUILD_COMMAND ${GENERATOR_MAKE} ${GENERATOR_MAKE_PARAMS} > /dev/null 2>&1 INSTALL_COMMAND ${GENERATOR_MAKE} install > /dev/null 2>&1) -find_package(Shiboken2 QUIET) -find_package(PySide2 QUIET) - set(PYTHON_LINK "${PYTHON_LIBRARY}") # ensure we link the whole python library so that modules have all the exports they need @@ -251,7 +248,13 @@ 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 AND TARGET Shiboken2::libshiboken AND TARGET PySide2::pyside2) + file(APPEND + ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri + "DEFINES+=PYSIDE2_ENABLED=0\n") +else() + find_package(Shiboken2 QUIET REQUIRED) + find_package(PySide2 QUIET REQUIRED) + message(STATUS "Building with PySide2 ${PySide2_VERSION} from ${PySide2_DIR}") if(NOT PYTHONLIBS_VERSION_STRING MATCHES "${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}") @@ -280,12 +283,6 @@ elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND T "DEFINES+=PYSIDE2_ENABLED=1\n" "DEFINES+=PYSIDE2_SYS_PATH=${PYSIDE_PYTHONPATH}\n" "LIBS+=-lshiboken2${SHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX}\n") -else() - message(STATUS "PySide2 not found - Qt will not be accessible in python scripting. See https://github.com/baldurk/renderdoc/wiki/PySide2") - - file(APPEND - ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri - "DEFINES+=PYSIDE2_ENABLED=0\n") endif() # generate the SWIG interface files -- 2.35.1