mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Remove custom FindPySide2.cmake, rely on normal packaging
* It seems PySide2 packaging is much more stable now, so we can generally rely on the distro packages.
This commit is contained in:
@@ -131,6 +131,7 @@ ExternalProject_Add(custom_swig
|
||||
# Lastly find PySide 2, optionally, for Qt5 Python bindings
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
find_package(Shiboken2)
|
||||
find_package(PySide2)
|
||||
|
||||
set(PYTHON_LINK "${PYTHON_LIBRARY}")
|
||||
@@ -214,19 +215,31 @@ if(NOT BUILD_VERSION_DIST_CONTACT STREQUAL "")
|
||||
"DEFINES+=DISTRIBUTION_CONTACT='\\\\\"${BUILD_VERSION_DIST_CONTACT}\\\\\"'\n")
|
||||
endif()
|
||||
|
||||
if(PYSIDE2_FOUND)
|
||||
if(PySide2_FOUND)
|
||||
message(STATUS "Building with PySide2 ${PySide2_VERSION} from ${PySide2_DIR}")
|
||||
|
||||
get_target_property(SHIBOKEN2_INCLUDE_DIRS Shiboken2::libshiboken INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(PYSIDE2_INCLUDE_DIRS PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES)
|
||||
|
||||
# append each include dir
|
||||
foreach(DIR ${SHIBOKEN2_INCLUDE_DIRS})
|
||||
file(APPEND
|
||||
${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
|
||||
"INCLUDEPATH+=${DIR}\n")
|
||||
endforeach()
|
||||
|
||||
foreach(DIR ${PYSIDE2_INCLUDE_DIRS})
|
||||
file(APPEND
|
||||
${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
|
||||
"INCLUDEPATH+=${DIR}\n")
|
||||
endforeach()
|
||||
|
||||
# Add configuration for PySide2
|
||||
file(APPEND
|
||||
${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
|
||||
"DEFINES+=PYSIDE2_ENABLED=1\n"
|
||||
"DEFINES+=PYSIDE2_SYS_PATH=${PYSIDE2_PYTHON_PATH}\n"
|
||||
"INCLUDEPATH+=${PYSIDE2_INCLUDE_DIR}/PySide2\n"
|
||||
"INCLUDEPATH+=${PYSIDE2_INCLUDE_DIR}/PySide2/QtCore\n"
|
||||
"INCLUDEPATH+=${PYSIDE2_INCLUDE_DIR}/PySide2/QtGui\n"
|
||||
"INCLUDEPATH+=${PYSIDE2_INCLUDE_DIR}/PySide2/QtWidgets\n"
|
||||
"INCLUDEPATH+=${PYSIDE2_INCLUDE_DIR}/shiboken2\n"
|
||||
"LIBS+=-L${PYSIDE2_LIBRARY_DIR}\n"
|
||||
"LIBS+=-lshiboken2\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")
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
// warning C4522: 'Shiboken::AutoDecRef': multiple assignment operators specified
|
||||
#pragma warning(disable : 4522)
|
||||
#include <pyside.h>
|
||||
#include <pyside2_qtwidgets_python.h>
|
||||
#include <shiboken.h>
|
||||
|
||||
PyTypeObject **SbkPySide2_QtCoreTypes = NULL;
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Find PySide2
|
||||
#
|
||||
# PYSIDE2_INCLUDE_DIR - the folder for include files that contains PySide2/ and shiboken2/
|
||||
# PYSIDE2_PYTHON_PATH - the folder to add to python's sys.path to locate the PySide modules
|
||||
# PYSIDE2_LIBRARY_DIR - the folder containing the libshiboken2.so to link against with -lshiboken2
|
||||
# PYSIDE2_FOUND - true if PySide2 was successfully located
|
||||
|
||||
find_library(SHIBOKEN2_LIBRARY
|
||||
NAMES shiboken2)
|
||||
|
||||
get_filename_component(PYSIDE2_LIBRARY_DIR ${SHIBOKEN2_LIBRARY} DIRECTORY)
|
||||
|
||||
find_path(PYSIDE2_PACKAGE_INIT_PY
|
||||
NAMES PySide2/__init__.py)
|
||||
|
||||
get_filename_component(PYSIDE2_PACKAGE_DIR "${PYSIDE2_PACKAGE_INIT_PY}" DIRECTORY)
|
||||
get_filename_component(PYSIDE2_PYTHON_PATH "${PYSIDE2_PACKAGE_DIR}" DIRECTORY)
|
||||
|
||||
find_path(PYSIDE2_INCLUDE_DIR
|
||||
NAMES PySide2/pyside.h
|
||||
HINTS ${PYSIDE2_PACKAGE_DIR}/include
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(PySide2 DEFAULT_MSG PYSIDE2_INCLUDE_DIR PYSIDE2_PYTHON_PATH PYSIDE2_LIBRARY_DIR)
|
||||
|
||||
mark_as_advanced(PYSIDE2_INCLUDE_DIR PYSIDE2_PYTHON_PATH PYSIDE2_LIBRARY_DIR)
|
||||
Reference in New Issue
Block a user