Quote CMAKE_OSX_SYSROOT when checking for simulator SDK

With CMake 4.0 the CMAKE_OSX_SYSROOT is no longer automatically set
based on the CMAKE_OSX_DEPLOYMENT_TARGET or host platform, so the
variable will be empty by default.

Pick-to: 6.8
Change-Id: Icad8e044a9d58e995882672b27340c83eb0ae0a8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 91ec68313ae8a90fcc97e669e1cf386c952aa41f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2025-04-25 20:23:58 +02:00 committed by Qt Cherry-pick Bot
parent 9842c84f36
commit 8866613373

View File

@ -3541,7 +3541,7 @@ macro(qt6_standard_project_setup)
if(QT_OSX_ARCHITECTURES)
list(LENGTH QT_OSX_ARCHITECTURES qt_osx_arch_count)
endif()
if(NOT qt_osx_arch_count GREATER 1 AND ${CMAKE_OSX_SYSROOT} MATCHES "^[a-z]+simulator$")
if(NOT qt_osx_arch_count GREATER 1 AND "${CMAKE_OSX_SYSROOT}" MATCHES "^[a-z]+simulator$")
# Xcode expects the base SDK to be the device SDK
set(simulator_sysroot "${CMAKE_OSX_SYSROOT}")
string(REGEX REPLACE "simulator" "os" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")