diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 6e67f2093f..81f33e1a21 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -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.