From 6d6037be24bcbff5efada34ed39331c7c8b28f3b Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Fri, 26 Feb 2021 16:11:08 +0100 Subject: 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 --- src/process/CMakeLists.txt | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src/process/CMakeLists.txt') 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 + "$/Versions/A/Helpers/${qtWebEngineProcessName}.app" + COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/Helpers" + "$/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}) -- cgit v1.2.3