renderdoc-1.18-conditional-pyside.patch (2178B)
1 From e6c0ee16967d3aa79f645a5a0aad0d50c20987f4 Mon Sep 17 00:00:00 2001 2 From: Matthew Smith <matt@offtopica.uk> 3 Date: Sun, 20 Feb 2022 09:19:03 +0000 4 Subject: [PATCH] build: Only search for PySide2 if required 5 6 --- 7 qrenderdoc/CMakeLists.txt | 17 +++++++---------- 8 1 file changed, 7 insertions(+), 10 deletions(-) 9 10 diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt 11 index 05ad8ba89..e4470715e 100644 12 --- a/qrenderdoc/CMakeLists.txt 13 +++ b/qrenderdoc/CMakeLists.txt 14 @@ -154,9 +154,6 @@ ExternalProject_Add(custom_swig 15 BUILD_COMMAND ${GENERATOR_MAKE} ${GENERATOR_MAKE_PARAMS} > /dev/null 2>&1 16 INSTALL_COMMAND ${GENERATOR_MAKE} install > /dev/null 2>&1) 17 18 -find_package(Shiboken2 QUIET) 19 -find_package(PySide2 QUIET) 20 - 21 set(PYTHON_LINK "${PYTHON_LIBRARY}") 22 23 # ensure we link the whole python library so that modules have all the exports they need 24 @@ -251,7 +248,13 @@ option(QRENDERDOC_ENABLE_PYSIDE2 "Enable PySide2 if found" ON) 25 26 if(NOT QRENDERDOC_ENABLE_PYSIDE2) 27 message(STATUS "PySide2 integration disabled") 28 -elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND TARGET PySide2::pyside2) 29 + file(APPEND 30 + ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri 31 + "DEFINES+=PYSIDE2_ENABLED=0\n") 32 +else() 33 + find_package(Shiboken2 QUIET REQUIRED) 34 + find_package(PySide2 QUIET REQUIRED) 35 + 36 message(STATUS "Building with PySide2 ${PySide2_VERSION} from ${PySide2_DIR}") 37 38 if(NOT PYTHONLIBS_VERSION_STRING MATCHES "${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}") 39 @@ -280,12 +283,6 @@ elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND T 40 "DEFINES+=PYSIDE2_ENABLED=1\n" 41 "DEFINES+=PYSIDE2_SYS_PATH=${PYSIDE_PYTHONPATH}\n" 42 "LIBS+=-lshiboken2${SHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX}\n") 43 -else() 44 - message(STATUS "PySide2 not found - Qt will not be accessible in python scripting. See https://github.com/baldurk/renderdoc/wiki/PySide2") 45 - 46 - file(APPEND 47 - ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri 48 - "DEFINES+=PYSIDE2_ENABLED=0\n") 49 endif() 50 51 # generate the SWIG interface files 52 -- 53 2.35.1 54