diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-04-13 18:52:56 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-04-22 14:34:47 +0200 |
commit | 8a56b4ad9bcbafefd8de0caf102c300b7771e57b (patch) | |
tree | 2a3cefc05ba2f0439e087da87938e0be33205c09 /cmake | |
parent | 251033fb0addb9799f2b308b2fa4f7589e9886ac (diff) |
CMake: Embed an empty qt_prfxpath if Qt is relocatable
When Qt is configured as relocatable,
QT_CONFIGURE_PREFIX_PATH_STR -> qt_configure_prefix_path_str ->
qt_prfxpath
is not used in relevant code paths.
Specifically qlibraryinfo.cpp getPrefix() uses getRelocatablePrefix()
instead of QT_CONFIGURE_PREFIX_PATH.
Thus, when Qt is configured as relocatable, set qt_prfxpath to an
empty string.
This avoids embedding a CI path like /home/qt/work/install into the
official packages, which makes reproducible builds a closer reality.
Change-Id: I9209b08e651ad0b7fdc4049df333e0978e05f1f5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtQmakeHelpers.cmake | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cmake/QtQmakeHelpers.cmake b/cmake/QtQmakeHelpers.cmake index 0f623254fb..229c3a0fb4 100644 --- a/cmake/QtQmakeHelpers.cmake +++ b/cmake/QtQmakeHelpers.cmake @@ -57,11 +57,18 @@ function(qt_generate_qconfig_cpp in_file out_file) # Expected output is something like # C:/work/qt/install # so it includes a drive letter and forward slashes. - set(QT_CONFIGURE_PREFIX_PATH_STR "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}") - if(CMAKE_HOST_WIN32) - get_filename_component( - QT_CONFIGURE_PREFIX_PATH_STR - "${QT_CONFIGURE_PREFIX_PATH_STR}" REALPATH) + if(QT_FEATURE_relocatable) + # A relocatable Qt does not need a hardcoded prefix path. + # This makes reproducible builds a closer reality, because we don't embed a CI path + # into the binaries. + set(QT_CONFIGURE_PREFIX_PATH_STR "") + else() + set(QT_CONFIGURE_PREFIX_PATH_STR "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}") + if(CMAKE_HOST_WIN32) + get_filename_component( + QT_CONFIGURE_PREFIX_PATH_STR + "${QT_CONFIGURE_PREFIX_PATH_STR}" REALPATH) + endif() endif() configure_file(${in_file} ${out_file} @ONLY) |