summaryrefslogtreecommitdiffstats
path: root/src/process/CMakeLists.txt
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-02-26 16:11:08 +0100
committerMichal Klocek <michal.klocek@qt.io>2021-05-22 14:10:17 +0200
commit6d6037be24bcbff5efada34ed39331c7c8b28f3b (patch)
tree40febb3d86fa4742dcc2cebc9da80b1263456ba5 /src/process/CMakeLists.txt
parent68de090b1fce66f36743d31f384398af8c140a1d (diff)
Add mac builds to cmake
We need to pass -F or -iframework to gn as a compiler flag, however cmake keeps this parameter as include dir and adds internally "-iframework QtFoo.framework/.." for the compiler call. This internal handling can not be accessed with the genex. Add the manual conversion. Task-number: QTBUG-91760 Change-Id: Id12831432ccb0516be52f79bd5f6cfcbe7e87d9c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/process/CMakeLists.txt')
-rw-r--r--src/process/CMakeLists.txt27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt
index 742fecf0c..7f1b40b90 100644
--- a/src/process/CMakeLists.txt
+++ b/src/process/CMakeLists.txt
@@ -6,6 +6,7 @@ include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
find_package(Qt6 COMPONENTS Gui)
get_target_property(qtWebEngineProcessName WebEngineCore QTWEBENGINEPROCESS_NAME)
+get_target_property(isFramework WebEngineCore FRAMEWORK)
qt_internal_add_executable(${qtWebEngineProcessName} SOURCES main.cpp)
@@ -21,9 +22,27 @@ target_link_libraries(${qtWebEngineProcessName}
target_include_directories(${qtWebEngineProcessName} PRIVATE ../core)
get_install_config(config)
-install(TARGETS ${qtWebEngineProcessName}
- RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}"
- CONFIGURATIONS ${config}
-)
+if(isFramework)
+ set_target_properties(${qtWebEngineProcessName} PROPERTIES MACOSX_BUNDLE TRUE)
+ target_sources(${qtWebEngineProcessName} PRIVATE QtWebEngineProcess.entitlements)
+ set_source_files_properties(QtWebEngineProcess.entitlements PROPERTIES
+ MACOSX_PACKAGE_LOCATION Resources
+ )
+ add_custom_command(TARGET ${qtWebEngineProcessName} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory
+ "$<TARGET_BUNDLE_DIR:WebEngineCore>/Versions/A/Helpers/${qtWebEngineProcessName}.app"
+ COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/Helpers"
+ "$<TARGET_BUNDLE_DIR:WebEngineCore>/Helpers"
+ )
+ install(TARGETS ${qtWebEngineProcessName}
+ BUNDLE DESTINATION ./lib/QtWebEngineCore.framework/Versions/A/Helpers
+ COMPONENT Runtime
+ )
+else()
+ install(TARGETS ${qtWebEngineProcessName}
+ RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}"
+ CONFIGURATIONS ${config}
+ )
+endif()
make_install_only(${qtWebEngineProcessName})