From d6c80243dddccb68da95fb7061c33d5af706ae38 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 28 Oct 2020 15:08:18 +0100 Subject: 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 --- sources/pyside2/CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'sources') 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) -- cgit v1.2.3