CMake: Fix configuring a standalone test on Apple platforms
Configuring a test as standalone would fail with the following error: Invalid max SDK version: It should be a major version number, without minor This happened because _qt_internal_check_apple_sdk_and_xcode_versions expects QT_SUPPORTED_MAX_MACOS_SDK_VERSION to be available, but it is not yet set due to Qt6 package not being found yet. Avoid the issue by exporting the version requirements into both Qt6ConfigExtras.cmake and Qt6BuildInternalsConfigExtra.cmake. Make sure to assign the variables only once. Amends a29bff3d80219f54d0837b0e6e0577192011dea1 Amends a0bdd2195f24d8a7d880ba506afc16b41337218e Task-number: QTBUG-119490 Change-Id: Ic297eeaabf22c8c42ded1a766906f88fdb91fd3d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit cec2e42052a04cd2481c20bd4be5de2ba5ccaec2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit cfdffa17a545de73ae5419023a1c765f5b682fe0) (cherry picked from commit 6125a1db35727cabc4b4e29a9708c0416bf5c8f8)
This commit is contained in:
parent
5db954f944
commit
7308f44367
@ -715,6 +715,19 @@ set(QT_COPYRIGHT_YEAR \"${QT_COPYRIGHT_YEAR}\" CACHE STRING \"\")
|
||||
set(QT_COPYRIGHT \"${QT_COPYRIGHT}\" CACHE STRING \"\")
|
||||
")
|
||||
|
||||
# Add the apple version requirements to the BuildInternals extra code, so the info is
|
||||
# available when configuring a standalone test.
|
||||
# Otherwise when QtSetup is included after a
|
||||
# find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
|
||||
# call, Qt6ConfigExtras.cmake is not included yet, the requirements are not available and
|
||||
# _qt_internal_check_apple_sdk_and_xcode_versions() would fail.
|
||||
_qt_internal_export_apple_sdk_and_xcode_version_requirements(apple_requirements)
|
||||
if(apple_requirements)
|
||||
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "
|
||||
${apple_requirements}
|
||||
")
|
||||
endif()
|
||||
|
||||
qt_compute_relative_path_from_cmake_config_dir_to_prefix()
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake.in"
|
||||
|
@ -641,7 +641,11 @@ function(_qt_internal_export_apple_sdk_and_xcode_version_requirements out_var)
|
||||
set(assignments "")
|
||||
foreach(var IN LISTS vars_to_assign)
|
||||
set(value "${${var}}")
|
||||
list(APPEND assignments "set(${var} \"${value}\")")
|
||||
list(APPEND assignments
|
||||
"
|
||||
if(NOT ${var})
|
||||
set(${var} \"${value}\")
|
||||
endif()")
|
||||
endforeach()
|
||||
|
||||
list(JOIN assignments "\n" assignments)
|
||||
|
Loading…
x
Reference in New Issue
Block a user