From 3fc526499f8279c3507c4e534fb8dd3a7e968482 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 30 Aug 2021 17:45:10 +0200 Subject: Adjust install and copy path for locales and resources In case of top level build with prefix, make sure we also copy resources and locales to build dir, so tests can be executed without installing. Task-number: QTBUG-95590 Change-Id: Ie64e650259b2c38a6eda8d15a94f7101ad8380a8 Reviewed-by: Qt CI Bot Reviewed-by: Allan Sandfeld Jensen (cherry picked from commit f2153965c8f8459af4edcf30d69b4f1e81085cb4) Reviewed-by: Qt Cherry-pick Bot --- src/core/api/CMakeLists.txt | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt index 7f0380216..e711d362a 100644 --- a/src/core/api/CMakeLists.txt +++ b/src/core/api/CMakeLists.txt @@ -128,19 +128,27 @@ if(QT_FEATURE_framework) add_custom_command(OUTPUT ${allResourceFiles} DEPENDS ${buildDir}/${config}/${arch}/QtWebEngineCore.stamp) add_custom_target(generate_resources_${config} DEPENDS ${allResourceFiles}) else() - install(FILES ${localeFiles} - DESTINATION ${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales - CONFIGURATIONS ${config} - ) - install(FILES ${resourceFiles} - DESTINATION ${INSTALL_DATADIR}/resources - CONFIGURATIONS ${config} - ) if(NOT QT_WILL_INSTALL) set(rootPath ${CMAKE_INSTALL_PREFIX}) else() - set(rootPath ${PROJECT_BINARY_DIR}) + 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}/translations/qtwebengine_locales) - addCopyCommand(WebEngineCore "${resourceFiles}" ${rootPath}/resources) + addCopyCommand(WebEngineCore "${localeFiles}" + ${rootPath}/${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales + ) + addCopyCommand(WebEngineCore "${resourceFiles}" + ${rootPath}/${INSTALL_DATADIR}/resources + ) endif() -- cgit v1.2.3