aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside2/CMakeLists.txt3
-rw-r--r--sources/pyside2/PySide2/CMakeLists.txt15
-rw-r--r--sources/pyside2/cmake/Macros/PySideModules.cmake2
3 files changed, 11 insertions, 9 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt
index d4bb023a0..e880a3e69 100644
--- a/sources/pyside2/CMakeLists.txt
+++ b/sources/pyside2/CMakeLists.txt
@@ -230,9 +230,6 @@ macro(COLLECT_MODULE_IF_FOUND shortname)
if(${_name_found})
message(STATUS "module ${name} found (${ARGN})")
- # Put the module at the end of pyside2_global.h
- file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/PySide2/pyside2_global.h.add"
- "#include \"Qt${shortname}/Qt${shortname}\"\n")
# record the shortnames for the tests
list(APPEND all_module_shortnames ${shortname})
else()
diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt
index 601c43ed6..0b8210359 100644
--- a/sources/pyside2/PySide2/CMakeLists.txt
+++ b/sources/pyside2/PySide2/CMakeLists.txt
@@ -30,15 +30,20 @@ else()
"${CMAKE_CURRENT_BINARY_DIR}/support/signature/backport_inspect.py" COPYONLY)
endif()
-# Add the collected includes to the global include
-file(READ "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h.add" GLOBAL_APPEND)
-file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h" "${GLOBAL_APPEND}")
-file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h.add")
-
# now compile all modules.
+file(READ "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h" pyside2_global_contents)
+
foreach(shortname IN LISTS all_module_shortnames)
set(name "Qt5${shortname}")
HAS_QT_MODULE(${name}_FOUND Qt${shortname})
+
+ # Create a module header consisting of pyside2_global.h and the module
+ # include. Note: The contents of pyside2_global.h must be copied instead of
+ # just #including it since shiboken will otherwise generate an
+ # #include <pyside2_global.h> for the the type entries originating from it
+ # (cf AbstractMetaBuilderPrivate::setInclude()).
+ set(module_header "${CMAKE_CURRENT_BINARY_DIR}/Qt${shortname}_global.h")
+ file(WRITE ${module_header} "${pyside2_global_contents}\n#include <Qt${shortname}/Qt${shortname}>\n")
endforeach()
# install
diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake
index c4177a8d7..2f0917f7f 100644
--- a/sources/pyside2/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside2/cmake/Macros/PySideModules.cmake
@@ -83,7 +83,7 @@ macro(create_pyside_module
add_custom_command(OUTPUT ${${module_sources}}
COMMAND "${SHIBOKEN_BINARY}" ${GENERATOR_EXTRA_FLAGS}
- ${pyside2_BINARY_DIR}/pyside2_global.h
+ "${pyside2_BINARY_DIR}/${module_name}_global.h"
--include-paths=${shiboken_include_dirs}
${shiboken_framework_include_dirs_option}
--typesystem-paths=${pyside2_SOURCE_DIR}${PATH_SEP}${${module_typesystem_path}}