aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/scriptableapplication/CMakeLists.txt9
-rw-r--r--examples/scriptableapplication/scriptableapplication.pro3
2 files changed, 12 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)
diff --git a/examples/scriptableapplication/scriptableapplication.pro b/examples/scriptableapplication/scriptableapplication.pro
index 9f888f6a0..bcb05c115 100644
--- a/examples/scriptableapplication/scriptableapplication.pro
+++ b/examples/scriptableapplication/scriptableapplication.pro
@@ -12,6 +12,9 @@ TYPESYSTEM_FILE = scriptableapplication.xml
QT_INCLUDEPATHS = -I$$[QT_INSTALL_HEADERS] -I$$[QT_INSTALL_HEADERS]/QtCore \
-I$$[QT_INSTALL_HEADERS]/QtGui -I$$[QT_INSTALL_HEADERS]/QtWidgets
+# On macOS, check if Qt is a framework build. This affects how include paths should be handled.
+qtConfig(framework): QT_INCLUDEPATHS += --framework-include-paths=$$[QT_INSTALL_LIBS]
+
SHIBOKEN_OPTIONS = --generator-set=shiboken --enable-parent-ctor-heuristic \
--enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero \
$$QT_INCLUDEPATHS -I$$PWD -T$$PWD -T$$PYSIDE2/typesystems --output-directory=$$OUT_PWD