diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2024-03-19 11:34:15 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2024-03-20 09:57:13 +0100 |
commit | 7b4c6ff81d047e7f5b43fd3a2a70840a75bd05b9 (patch) | |
tree | 53e920d1cfc25bd1e4f3555ecbef58af58744fac /cmake | |
parent | 4b63662c4556cd989a00c42ed657908db68d3e9a (diff) |
CMake: Fix finding standalone parts config file for yocto
When building standalone tests of qtsvg targeting yocto, the
standalone parts config file was not found.
That's because it specifies a new CMAKE_STAGING_PREFIX for each built
repo, and the QtSvgTestsConfig.cmake file will be located there,
rather than in QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX, where
the QtBuildInternalsConfig.cmake file is.
So in this case, we always have to prefer looking into
CMAKE_STAGING_PREFIX for the file.
Amends 62905163bf887c2c2c9ba7edcd64c96d237a6e95
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I8902381afa4267e40dfb2ad47e44285a806a35e2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 270315e019a569bebf83e7c293b44f36c555fb3c)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuildRepoHelpers.cmake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmake/QtBuildRepoHelpers.cmake b/cmake/QtBuildRepoHelpers.cmake index 6a49baadf1..680467a9fe 100644 --- a/cmake/QtBuildRepoHelpers.cmake +++ b/cmake/QtBuildRepoHelpers.cmake @@ -488,7 +488,15 @@ function(qt_get_standalone_parts_config_files_path out_var) set(dir_name "StandaloneTests") set(path_suffix "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}BuildInternals/${dir_name}") - set(path "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${path_suffix}") + + # Each repo's standalone parts might be configured with a unique CMAKE_STAGING_PREFIX, + # different from any previous one, and it might not coincide with where the BuildInternals + # config file is. + if(QT_WILL_INSTALL AND CMAKE_STAGING_PREFIX) + qt_path_join(path "${CMAKE_STAGING_PREFIX}" "${path_suffix}") + else() + qt_path_join(path "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}" "${path_suffix}") + endif() set("${out_var}" "${path}" PARENT_SCOPE) endfunction() |