diff options
Diffstat (limited to 'sources/pyside2/PySide2/CMakeLists.txt')
-rw-r--r-- | sources/pyside2/PySide2/CMakeLists.txt | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt index 931842b00..21db337e9 100644 --- a/sources/pyside2/PySide2/CMakeLists.txt +++ b/sources/pyside2/PySide2/CMakeLists.txt @@ -32,15 +32,36 @@ else() "${CMAKE_CURRENT_BINARY_DIR}/support/signature/typing.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") + set(module_header_content "") + set(pre_header "${CMAKE_CURRENT_BINARY_DIR}/Qt${shortname}/Qt${shortname}_global.pre.h") + if(EXISTS "${pre_header}") + file(READ "${pre_header}" pre_header_content) + set(module_header_content "${pre_header_content}") + endif() + set(module_header_content "${module_header_content}\n${pyside2_global_contents}") + # AxContainer/AxServer from Active Qt do not have module headers + if(NOT "${shortname}" STREQUAL "AxContainer") + set(module_header_content "${module_header_content}\n#include <Qt${shortname}/Qt${shortname}>") + endif() + set(post_header "${CMAKE_CURRENT_BINARY_DIR}/Qt${shortname}/Qt${shortname}_global.post.h") + if(EXISTS "${post_header}") + file(READ "${post_header}" post_header_content) + set(module_header_content "${module_header_content}\n${post_header_content}") + endif() + file(WRITE ${module_header} "${module_header_content}") endforeach() # install |