From f78cc32299aa34069c64ae8f48163ac4eda560d5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 8 Nov 2017 14:37:35 +0100 Subject: 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 --- sources/pyside2/PySide2/QtTest/CMakeLists.txt | 6 ++++++ sources/pyside2/PySide2/QtTest/QtTest_global.post.h.in | 1 + sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 sources/pyside2/PySide2/QtTest/QtTest_global.post.h.in create mode 100644 sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in (limited to 'sources/pyside2/PySide2/QtTest') diff --git a/sources/pyside2/PySide2/QtTest/CMakeLists.txt b/sources/pyside2/PySide2/QtTest/CMakeLists.txt index 5893de7ba..6d2630f10 100644 --- a/sources/pyside2/PySide2/QtTest/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtTest/CMakeLists.txt @@ -7,6 +7,12 @@ ${QtTest_GEN_DIR}/qtest_wrapper.cpp ${QtTest_GEN_DIR}/qttest_module_wrapper.cpp ) +configure_file("${QtTest_SOURCE_DIR}/QtTest_global.pre.h.in" + "${QtTest_BINARY_DIR}/QtTest_global.pre.h" @ONLY) + +configure_file("${QtTest_SOURCE_DIR}/QtTest_global.post.h.in" + "${QtTest_BINARY_DIR}/QtTest_global.post.h" @ONLY) + set(QtTest_include_dirs ${QtTest_SOURCE_DIR} ${QtTest_BINARY_DIR} ${Qt5Core_INCLUDE_DIRS} diff --git a/sources/pyside2/PySide2/QtTest/QtTest_global.post.h.in b/sources/pyside2/PySide2/QtTest/QtTest_global.post.h.in new file mode 100644 index 000000000..ccd18153c --- /dev/null +++ b/sources/pyside2/PySide2/QtTest/QtTest_global.post.h.in @@ -0,0 +1 @@ +#include "pysideqtesttouch.h" diff --git a/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in b/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in new file mode 100644 index 000000000..65daf1b84 --- /dev/null +++ b/sources/pyside2/PySide2/QtTest/QtTest_global.pre.h.in @@ -0,0 +1,5 @@ +// QT_WIDGETS_LIB changes code generation in pysideqtesttouch.h + +#if @Qt5Widgets_FOUND@ +# define QT_WIDGETS_LIB +#endif -- cgit v1.2.3