diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-01-06 16:33:29 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2017-02-16 09:30:52 +0000 |
commit | b262da528e2d6346c528f523d15e8e067ddd7a17 (patch) | |
tree | 10b05f55e85fb475f7d2668ec98a45c440c22be3 | |
parent | fa2a90241bf31d9680017f043aaee97af8e4c2fd (diff) |
Pass macOS framework directories to shiboken's preprocessor
On macOS shiboken skipped all methods that contained OpenGL types like
GLuint. This happened because gl.h was included using an absolute path
which is generated inside global.h.in, whereas subsequent includes like
OpenGL/gltypes.h did not get resolved by the preprocessor due to
missing include paths.
Fix consists in taking the system framework paths that CMake knows
about, and passing them as additional include paths to shiboken.
Task-number: PYSIDE-457
Change-Id: Ic7d9157e95f370074b03bbfbe2f0691a0798a4df
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | cmake/Macros/PySideModules.cmake | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cmake/Macros/PySideModules.cmake b/cmake/Macros/PySideModules.cmake index 5cf080ac..5b493f4a 100644 --- a/cmake/Macros/PySideModules.cmake +++ b/cmake/Macros/PySideModules.cmake @@ -67,10 +67,20 @@ macro(create_pyside_module # Remove any possible duplicates. list(REMOVE_DUPLICATES total_type_system_files) + # Contains include directories to pass to shiboken's preprocessor. + set(shiboken_include_dirs ${pyside2_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}) + if(CMAKE_HOST_APPLE) + # On macOS, provide the framework paths for OpenGL headers. + set(shiboken_include_dirs ${shiboken_include_dirs} ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + endif() + + # Transform the path separators into something shiboken understands. + make_path(shiboken_include_dirs ${shiboken_include_dirs}) + add_custom_command(OUTPUT ${${module_sources}} COMMAND "${SHIBOKEN_BINARY}" ${GENERATOR_EXTRA_FLAGS} ${pyside2_BINARY_DIR}/pyside2_global.h - --include-paths=${pyside2_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR} + --include-paths=${shiboken_include_dirs} --typesystem-paths=${pyside2_SOURCE_DIR}${PATH_SEP}${${module_typesystem_path}} --output-directory=${CMAKE_CURRENT_BINARY_DIR} --license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt |