diff options
| author | Michal Klocek <michal.klocek@qt.io> | 2021-09-30 08:09:21 +0200 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-10-28 15:31:03 +0000 |
| commit | 03aa3ebb91683eb48c263d8d6575d5935e5352e2 (patch) | |
| tree | 969b52cf9a9c87093ff2f92d3a2fe2a457124d04 | |
| parent | 7ee686fbd9483beaac486a378239e1033060bcf8 (diff) | |
| download | qtwebengine-03aa3ebb91683eb48c263d8d6575d5935e5352e2.tar.gz | |
Fix setup for 'no-prefix' builds
QT_SUPERBUILD is never cached and user can run
only qtbase as super build and compile any other
module as separate module build, moreover this can be
also 'no prefix' build.
Fix missing checks to support that case and clean up
install of resources.
For mac framework builds copy bundle to right place
in case of 'no-prefix' builds.
Fixes: QTBUG-94604
Task-number: QTBUG-96375
Change-Id: I4ab7d4fed2c2be93f2a048a510419849361883ba
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c733f89eaf0c6bf70ab35666a4ef38490abca828)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| -rw-r--r-- | cmake/Functions.cmake | 12 | ||||
| -rw-r--r-- | src/core/api/CMakeLists.txt | 35 | ||||
| -rw-r--r-- | src/process/CMakeLists.txt | 17 |
3 files changed, 38 insertions, 26 deletions
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake index 19d6b0ca0..6c7a49415 100644 --- a/cmake/Functions.cmake +++ b/cmake/Functions.cmake @@ -76,7 +76,7 @@ function(get_qt_features outList module) endfunction() function(create_cxx_config cmakeTarget arch configFileName) - if(NOT QT_SUPERBUILD) + if(NOT QT_SUPERBUILD AND QT_WILL_INSTALL) get_target_property(mocFilePath Qt6::moc IMPORTED_LOCATION) else() set(mocFilePath "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/moc${CMAKE_EXECUTABLE_SUFFIX}") @@ -1034,6 +1034,16 @@ function(addCopyCommand target src dst) ) endfunction() +function(addCopyDirCommand target src dst) + add_custom_command( + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${src} ${dst} + TARGET ${target} + DEPENDS ${src} + USES_TERMINAL + ) +endfunction() + function(check_for_ulimit) message("-- Checking 'ulimit -n'") execute_process(COMMAND bash -c "ulimit -n" diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt index c74ac84ee..4ef5d0c67 100644 --- a/src/core/api/CMakeLists.txt +++ b/src/core/api/CMakeLists.txt @@ -141,27 +141,20 @@ if(QT_FEATURE_framework) add_custom_command(OUTPUT ${allResourceFiles} DEPENDS ${buildDir}/${config}/${arch}/QtWebEngineCore.stamp) add_custom_target(generate_resources_${config} DEPENDS ${allResourceFiles}) else() - if(NOT QT_WILL_INSTALL) - set(rootPath ${CMAKE_INSTALL_PREFIX}) - else() - if(NOT QT_SUPERBUILD) - set(rootPath ${PROJECT_BINARY_DIR}) - else() - set(rootPath ${QT_BUILD_DIR}) - endif() - install(FILES ${localeFiles} - DESTINATION ${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales - CONFIGURATIONS ${config} - ) - install(FILES ${resourceFiles} - DESTINATION ${INSTALL_DATADIR}/resources - CONFIGURATIONS ${config} - ) - endif() - addCopyCommand(WebEngineCore "${localeFiles}" - ${rootPath}/${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales + install(FILES ${localeFiles} + DESTINATION ${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales + CONFIGURATIONS ${config} ) - addCopyCommand(WebEngineCore "${resourceFiles}" - ${rootPath}/${INSTALL_DATADIR}/resources + install(FILES ${resourceFiles} + DESTINATION ${INSTALL_DATADIR}/resources + CONFIGURATIONS ${config} ) + if(QT_SUPERBUILD OR NOT QT_WILL_INSTALL) + addCopyCommand(WebEngineCore "${localeFiles}" + ${QT_BUILD_DIR}/${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales + ) + addCopyCommand(WebEngineCore "${resourceFiles}" + ${QT_BUILD_DIR}/${INSTALL_DATADIR}/resources + ) + endif() endif() diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt index 8d146aa61..8628500c0 100644 --- a/src/process/CMakeLists.txt +++ b/src/process/CMakeLists.txt @@ -44,12 +44,14 @@ qt_get_cmake_configurations(configs) foreach(config ${configs}) string(TOUPPER "${config}" config_upper) set_target_properties(${qtWebEngineProcessName} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY_${config_upper} "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}") + RUNTIME_OUTPUT_DIRECTORY_${config_upper} "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}" + ) endforeach() if(QT_FEATURE_debug_and_release) set_target_properties(${qtWebEngineProcessName} PROPERTIES - OUTPUT_NAME_DEBUG ${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX}) + OUTPUT_NAME_DEBUG ${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX} + ) endif() if(isFramework) @@ -70,10 +72,17 @@ if(isFramework) USES_TERMINAL ) install(TARGETS ${qtWebEngineProcessName} - BUNDLE DESTINATION ./lib/QtWebEngineCore.framework/Versions/A/Helpers + BUNDLE DESTINATION "${INSTALL_LIBDIR}/QtWebEngineCore.framework/Versions/A/Helpers" COMPONENT Runtime ) - qt_enable_separate_debug_info(${qtWebEngineProcessName} ./lib/QtWebEngineCore.framework/Versions/A/Helpers QT_EXECUTABLE) + if(QT_SUPERBUILD OR NOT QT_WILL_INSTALL) + addCopyDirCommand(${qtWebEngineProcessName} "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${qtWebEngineProcessName}.app" + "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/QtWebEngineCore.framework/Versions/A/Helpers/${qtWebEngineProcessName}.app/" + ) + endif() + qt_enable_separate_debug_info(${qtWebEngineProcessName} + "${INSTALL_LIBDIR}/QtWebEngineCore.framework/Versions/A/Helpers" QT_EXECUTABLE + ) else() qt_apply_rpaths(TARGET ${qtWebEngineProcessName} INSTALL_PATH "${INSTALL_LIBEXECDIR}" RELATIVE_RPATH) install(TARGETS ${qtWebEngineProcessName} |
