Set a default value for CMAKE_OSX_DEPLOYMENT_TARGET

This replicates the behavior of QMAKE_MACOSX_DEPLOYMENT_TARGET in
qmake.

Change-Id: I273cd26994f2edfc52dc7b6278252c37b65b2356
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexandru Croitor 2020-02-14 11:40:03 +01:00
parent 4ee289d2d8
commit e9672c747c

View File

@ -173,7 +173,22 @@ function(qt_auto_detect_cmake_config)
endif()
endfunction()
function(qt_auto_detect_darwin)
if(APPLE)
# If no CMAKE_OSX_DEPLOYMENT_TARGET is provided, default
# to a value that we choose. This replicates the behavior
# in mkspecs/common/macx.conf where
# QMAKE_MACOSX_DEPLOYMENT_TARGET is set.
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
endif()
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET set to: \"${CMAKE_OSX_DEPLOYMENT_TARGET}\".")
endif()
endfunction()
qt_auto_detect_cmake_config()
qt_auto_detect_darwin()
qt_auto_detect_ios()
qt_auto_detect_android()
qt_auto_detect_vpckg()