CMake: Propagate qtbase's CMAKE_STAGING_PREFIX to Qt modules
When qtbase is configured with CMAKE_STAGING_PREFIX set, then Qt modules built against this qtbase should also get CMAKE_STAGING_PREFIX by default. Like CMAKE_INSTALL_PREFIX in regular builds, this prefix will be determined by the location of QtBuildInternalsExtra.cmake to support building Qt modules against an installer-provided Qt. CMAKE_INSTALL_PREFIX on the other hand must be exactly the value that was provided when building qtbase. If CMAKE_STAGING_PREFIX is specified by the user, honor it. To opt out of automatically setting CMAKE_STAGING_PREFIX, set QT_BUILD_INTERNALS_NO_FORCE_SET_STAGING_PREFIX to ON. Remove the old code that was supposed to set CMAKE_STAGING_PREFIX. Fixes: QTBUG-99666 Change-Id: I20edef54c102ca9784fcdef0decf0bd83266ae11 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 037fd545c485e73ac68377a264c84208592dc74f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
34d9069012
commit
284862fefb
@ -26,6 +26,7 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND
|
|||||||
AND NOT QT_SUPERBUILD)
|
AND NOT QT_SUPERBUILD)
|
||||||
set(qtbi_orig_prefix "@CMAKE_INSTALL_PREFIX@")
|
set(qtbi_orig_prefix "@CMAKE_INSTALL_PREFIX@")
|
||||||
set(qtbi_new_prefix "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}")
|
set(qtbi_new_prefix "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}")
|
||||||
|
set(qtbi_orig_staging_prefix "@CMAKE_STAGING_PREFIX@")
|
||||||
if(CMAKE_HOST_WIN32)
|
if(CMAKE_HOST_WIN32)
|
||||||
# Make sure we use exactly the original prefix if it points to the same directory as the new
|
# Make sure we use exactly the original prefix if it points to the same directory as the new
|
||||||
# one. This is needed for the case where the original prefix is passed without drive letter
|
# one. This is needed for the case where the original prefix is passed without drive letter
|
||||||
@ -36,12 +37,20 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND
|
|||||||
set(qtbi_new_prefix "${qtbi_orig_prefix}")
|
set(qtbi_new_prefix "${qtbi_orig_prefix}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
if(NOT qtbi_orig_staging_prefix STREQUAL ""
|
||||||
|
AND "${CMAKE_STAGING_PREFIX}" STREQUAL ""
|
||||||
|
AND NOT QT_BUILD_INTERNALS_NO_FORCE_SET_STAGING_PREFIX)
|
||||||
|
set(CMAKE_STAGING_PREFIX "${qtbi_new_prefix}" CACHE PATH
|
||||||
|
"Staging path prefix, prepended onto install directories on the host machine." FORCE)
|
||||||
|
set(qtbi_new_prefix "${qtbi_orig_prefix}")
|
||||||
|
endif()
|
||||||
set(CMAKE_INSTALL_PREFIX "${qtbi_new_prefix}" CACHE PATH
|
set(CMAKE_INSTALL_PREFIX "${qtbi_new_prefix}" CACHE PATH
|
||||||
"Install path prefix, prepended onto install directories." FORCE)
|
"Install path prefix, prepended onto install directories." FORCE)
|
||||||
unset(qtbi_orig_prefix)
|
unset(qtbi_orig_prefix)
|
||||||
unset(qtbi_real_orig_prefix)
|
unset(qtbi_real_orig_prefix)
|
||||||
unset(qtbi_new_prefix)
|
unset(qtbi_new_prefix)
|
||||||
unset(qtbi_real_new_prefix)
|
unset(qtbi_real_new_prefix)
|
||||||
|
unset(qtbi_orig_staging_prefix)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Propagate developer builds to other modules via BuildInternals package.
|
# Propagate developer builds to other modules via BuildInternals package.
|
||||||
|
@ -659,18 +659,6 @@ endif()\n")
|
|||||||
"set(OPENSSL_ROOT_DIR \"${openssl_root_cmake_path}\" CACHE STRING \"\")\n")
|
"set(OPENSSL_ROOT_DIR \"${openssl_root_cmake_path}\" CACHE STRING \"\")\n")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT "${CMAKE_STAGING_PREFIX}" STREQUAL "")
|
|
||||||
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
|
|
||||||
"
|
|
||||||
# If no explicit CMAKE_STAGING_PREFIX is provided, force set the original Qt staging prefix,
|
|
||||||
if(\"$\{CMAKE_STAGING_PREFIX}\" STREQUAL \"\"
|
|
||||||
AND NOT QT_BUILD_INTERNALS_NO_FORCE_SET_STAGING_PREFIX)
|
|
||||||
set(CMAKE_STAGING_PREFIX \"${CMAKE_STAGING_PREFIX}\" CACHE PATH
|
|
||||||
\"Staging path prefix, prepended onto install directories on the host machine.\" FORCE)
|
|
||||||
endif()
|
|
||||||
")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
qt_generate_install_prefixes(install_prefix_content)
|
qt_generate_install_prefixes(install_prefix_content)
|
||||||
|
|
||||||
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "${install_prefix_content}")
|
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "${install_prefix_content}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user