aboutsummaryrefslogtreecommitdiffstats
path: root/examples/scriptableapplication/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-03-02 18:52:58 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-03-06 12:02:32 +0000
commit471b05f35a9c57d7fa910cf9f11c7f5fdfbf2a93 (patch)
tree9646a8e990a85a19487c6f52b52ab4075348d31a /examples/scriptableapplication/CMakeLists.txt
parent63bcb1ba4a1b211f219b1b47aa4b3ad85a8b7a77 (diff)
Fix scriptableapplication to build on macOS with framework Qt
In case of a Qt framework build, shiboken needs to be passed a --framework-include-paths=foo parameter pointing to the Qt framework libdir. This is used by the C++ parser to resolve framework include paths. Task-number: PYSIDE-623 Change-Id: I38cf34a51102265056aea8718ad059aea3438354 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/scriptableapplication/CMakeLists.txt')
-rw-r--r--examples/scriptableapplication/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/scriptableapplication/CMakeLists.txt b/examples/scriptableapplication/CMakeLists.txt
index 40e29346a..6641d77c6 100644
--- a/examples/scriptableapplication/CMakeLists.txt
+++ b/examples/scriptableapplication/CMakeLists.txt
@@ -58,6 +58,15 @@ foreach(INCLUDE_DIR ${QT_INCLUDE_DIRS})
list(APPEND INCLUDES "-I${INCLUDE_DIR}")
endforeach()
+# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
+get_target_property(QtCore_is_framework Qt5::Core FRAMEWORK)
+if (QtCore_is_framework)
+ get_target_property(qt_core_library_location Qt5::Core LOCATION)
+ get_filename_component(qt_core_library_location_dir "${qt_core_library_location}" DIRECTORY)
+ get_filename_component(lib_dir "${qt_core_library_location_dir}/../" ABSOLUTE)
+ list(APPEND INCLUDES "--framework-include-paths=${lib_dir}")
+endif()
+
# Set up the options to pass to shiboken.
set(WRAPPED_HEADER ${CMAKE_SOURCE_DIR}/wrappedclasses.h)
set(TYPESYSTEM_FILE ${CMAKE_SOURCE_DIR}/scriptableapplication.xml)