BUG: Allow third component of Mac OSX sw_vers output to be empty. Mac OSX 10.5 was recently reinstalled on dashmacmini3 and pointed out the fact that this expression is faulty when the reported version is simply 10.5 rather than 10.5.x... for example. This fixes it.

This commit is contained in:
David Cole 2009-02-17 16:59:58 -05:00
parent ab629e28f3
commit 553ddde8d1
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ ENDIF(NOT _CMAKE_OSX_SDKS)
# Set CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT to the current version of OS X
EXECUTE_PROCESS(COMMAND sw_vers -productVersion OUTPUT_VARIABLE CURRENT_OSX_VERSION)
STRING(REGEX REPLACE "^.*(10)\\.([0-9]+)\\.([0-9]+).*$" "\\1.\\2"
STRING(REGEX REPLACE "^.*(10)\\.([0-9]+)\\.*([0-9]+)*.*$" "\\1.\\2"
CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT ${CURRENT_OSX_VERSION})
# Set CMAKE_OSX_SYSROOT_DEFAULT based on CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT.