Browse Source

OS X: Allow deployment target with "/" sysroot (#15040)

Allow the combination

 -DCMAKE_OSX_DEPLOYMENT_TARGET="10.8" -DCMAKE_OSX_SYSROOT="/"

to work.  Treat the "/" sysroot as targeting the current OS X version.
Jeremy Huddleston 11 years ago
parent
commit
5b4faeefe3
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Modules/Platform/Darwin.cmake

+ 2 - 0
Modules/Platform/Darwin.cmake

@@ -70,6 +70,8 @@ if(CMAKE_OSX_DEPLOYMENT_TARGET)
     set(_sdk_ver "${CMAKE_MATCH_1}")
   elseif("${_CMAKE_OSX_SYSROOT_ORIG}" MATCHES "^macosx([0-9]+\\.[0-9]+)$")
     set(_sdk_ver "${CMAKE_MATCH_1}")
+  elseif("${_CMAKE_OSX_SYSROOT_ORIG}" STREQUAL "/")
+    set(_sdk_ver "${_CURRENT_OSX_VERSION}")
   else()
     message(FATAL_ERROR
       "CMAKE_OSX_DEPLOYMENT_TARGET is '${CMAKE_OSX_DEPLOYMENT_TARGET}' "