aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/CMakeLists.txt
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-11-08 14:37:35 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-11-11 10:33:09 +0000
commitf78cc32299aa34069c64ae8f48163ac4eda560d5 (patch)
tree7cd611c471a7eaebe20536544cb68b6df533f8b5 /sources/pyside2/PySide2/CMakeLists.txt
parent5db35b37ac2401697a6238f21979fa1e84f0ff77 (diff)
Clean up pyside2_global.h
Make it possible to prepend or append something to the global module header by providing a .pre/.post.h file. This removes the need to have global includes and defines in pyside2_global.h and reduces module dependencies. Change-Id: I517c5765212813732b5694dcfcc86d2492e71a57 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/CMakeLists.txt')
-rw-r--r--sources/pyside2/PySide2/CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt
index 0b8210359..3406bd458 100644
--- a/sources/pyside2/PySide2/CMakeLists.txt
+++ b/sources/pyside2/PySide2/CMakeLists.txt
@@ -43,7 +43,19 @@ foreach(shortname IN LISTS all_module_shortnames)
# #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")
+ 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}\n#include <Qt${shortname}/Qt${shortname}>\n")
+ 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