CMake: Allow skipping the fake install prefix for examples

Add CMake variable to allow use of DESTDIR when installing examples
in a standalone example build and skipping the fake prefix that would
be otherwise used. Similar variable is already used for tests.

Pick-to: 6.9 6.8
Change-Id: I427cbb5c198f8e89b1685792b7c1d90413213254
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Samuli Piippo 2025-05-09 09:09:11 +03:00
parent d205844e51
commit 406d5c6315

View File

@ -224,7 +224,7 @@ function(qt_internal_get_example_install_prefix out_var)
# Allow customizing the installation path of the examples. Will be used in CI.
if(QT_INTERNAL_EXAMPLES_INSTALL_PREFIX)
set(qt_example_install_prefix "${QT_INTERNAL_EXAMPLES_INSTALL_PREFIX}")
elseif(QT_BUILD_STANDALONE_EXAMPLES)
elseif(QT_BUILD_STANDALONE_EXAMPLES AND NOT QT_NO_FAKE_STANDALONE_EXAMPLE_INSTALL_PREFIX)
# TODO: We might need to reset and pipe through an empty CMAKE_STAGING_PREFIX if we ever
# try to run standalone examples in the CI when cross-compiling, similar how it's done in
# qt_internal_set_up_fake_standalone_parts_install_prefix.