aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-28 15:08:18 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-28 14:28:02 +0000
commitd6c80243dddccb68da95fb7061c33d5af706ae38 (patch)
tree978022c72e5b80728e4b6c1fbee365a9be8a3b10 /sources/pyside2
parentb78e5bd771f0d5a81692bc95f76929b092edf2f6 (diff)
PySide2: Fix the doc build
QT_INCLUDE_DIR obtained from Qt6::Core's INTERFACE_INCLUDE_DIRECTORIES contains a ';'-separated list of directories, which caused the shiboken doc run to fail. Iterate over the list to determine the root include directory. Change-Id: I5c639b59fc614e92430999fdbb800063131f7d6d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside2')
-rw-r--r--sources/pyside2/CMakeLists.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt
index cd228bf8b..50ec351fe 100644
--- a/sources/pyside2/CMakeLists.txt
+++ b/sources/pyside2/CMakeLists.txt
@@ -98,10 +98,18 @@ endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-# >= Qt5: QT_INCLUDE_DIR does no longer exist. Derive from QtCore
-get_target_property(QT_INCLUDE_DIR Qt6::Core INTERFACE_INCLUDE_DIRECTORIES)
-get_filename_component(QT_INCLUDE_DIR "${QT_INCLUDE_DIR}" DIRECTORY)
-message(STATUS "*** Qt ${QT_MAJOR_VERSION}, QT_INCLUDE_DIR= ${QT_INCLUDE_DIR}")
+# Obtain QT_INCLUDE_DIR from INTERFACE_INCLUDE_DIRECTORIES which returns a list
+# ../install-qt-6/include/QtCore;../install-qt-6/include
+set(QT_INCLUDE_DIR "")
+get_target_property(QT_INCLUDE_DIR_LIST Qt6::Core INTERFACE_INCLUDE_DIRECTORIES)
+foreach(_Q ${QT_INCLUDE_DIR_LIST})
+ if(NOT "${_Q}" MATCHES "QtCore$")
+ set(QT_INCLUDE_DIR "${_Q}")
+ endif()
+endforeach()
+if (QT_INCLUDE_DIR STREQUAL "")
+ message(FATAL_ERROR "Unable to obtain the Qt include directory")
+endif()
# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
get_target_property(QtCore_is_framework Qt${QT_MAJOR_VERSION}::Core FRAMEWORK)