[Cmake-commits] [cmake-commits] king committed Darwin-GNU-C.cmake 1.1.2.1 1.1.2.2 Darwin-GNU-CXX.cmake 1.1.2.1 1.1.2.2 Darwin-GNU.cmake 1.1.2.1 1.1.2.2 Darwin.cmake 1.61.2.1 1.61.2.2

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Feb 11 10:50:44 EST 2010


Update of /cvsroot/CMake/CMake/Modules/Platform
In directory public:/mounts/ram/cvs-serv14303/Modules/Platform

Modified Files:
      Tag: CMake-2-8
	Darwin-GNU-C.cmake Darwin-GNU-CXX.cmake Darwin-GNU.cmake 
	Darwin.cmake 
Log Message:
CMake 2.8.1-rc2


Index: Darwin-GNU.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/Darwin-GNU.cmake,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C 2 -d -r1.1.2.1 -r1.1.2.2
*** Darwin-GNU.cmake	28 Jan 2010 21:47:43 -0000	1.1.2.1
--- Darwin-GNU.cmake	11 Feb 2010 15:50:42 -0000	1.1.2.2
***************
*** 43,44 ****
--- 43,64 ----
    endif()
  endmacro()
+ 
+ macro(cmake_gnu_set_osx_deployment_target_flag lang)
+   if(NOT DEFINED CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG)
+     set(_doc "${lang} compiler supports OSX deployment target flag")
+     message(STATUS "Checking whether ${_doc}")
+     execute_process(
+       COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help"
+       OUTPUT_VARIABLE _gcc_help
+       ERROR_VARIABLE _gcc_help
+       )
+     if("${_gcc_help}" MATCHES "macosx-version-min")
+       message(STATUS "Checking whether ${_doc} - yes")
+       set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=")
+     else()
+       message(STATUS "Checking whether ${_doc} - no")
+       set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
+     endif()
+     set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG_CODE "SET(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG \"${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}\")")
+   endif()
+ endmacro()

Index: Darwin.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/Darwin.cmake,v
retrieving revision 1.61.2.1
retrieving revision 1.61.2.2
diff -C 2 -d -r1.61.2.1 -r1.61.2.2
*** Darwin.cmake	28 Jan 2010 21:47:43 -0000	1.61.2.1
--- Darwin.cmake	11 Feb 2010 15:50:42 -0000	1.61.2.2
***************
*** 2,9 ****
  
  # Darwin versions:
! #   6.x == Mac OSX 10.2
! #   7.x == Mac OSX 10.3
! #   8.x == Mac OSX 10.4
! #   9.x == Mac OSX 10.5
  STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}")
  STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}")
--- 2,10 ----
  
  # Darwin versions:
! #   6.x == Mac OSX 10.2 (Jaguar)
! #   7.x == Mac OSX 10.3 (Panther)
! #   8.x == Mac OSX 10.4 (Tiger)
! #   9.x == Mac OSX 10.5 (Leopard)
! #  10.x == Mac OSX 10.6 (Snow Leopard)
  STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}")
  STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}")
***************
*** 73,112 ****
  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"
!   CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT ${CURRENT_OSX_VERSION})
  
! # Set CMAKE_OSX_SYSROOT_DEFAULT based on CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT.
! # This next block assumes that Apple will start being consistent with
! # its SDK names from here on out...
! IF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT GREATER "10.4")
!   SET(CMAKE_OSX_SYSROOT_DEFAULT
!     "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT}.sdk")
! ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT GREATER "10.4")
  
! IF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT EQUAL "10.4")
    SET(CMAKE_OSX_SYSROOT_DEFAULT
      "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.4u.sdk")
! ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT EQUAL "10.4")
  
! IF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT EQUAL "10.3")
    SET(CMAKE_OSX_SYSROOT_DEFAULT
      "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.3.9.sdk")
! ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT EQUAL "10.3")
! 
! # Allow environment variables set by the user to override our defaults.
! # Use the same environment variables that Xcode uses.
! SET(ENV_MACOSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}")
! SET(ENV_SDKROOT "$ENV{SDKROOT}")
! 
! # See if we need to override the default SDK or Deployment target with the
! # environment variables
! IF(NOT ENV_MACOSX_DEPLOYMENT_TARGET STREQUAL "")
!   SET(CMAKE_OSX_DEPLOYMENT_TARGET_VALUE ${ENV_MACOSX_DEPLOYMENT_TARGET})
! ELSE(NOT ENV_MACOSX_DEPLOYMENT_TARGET STREQUAL "")
!   SET(CMAKE_OSX_DEPLOYMENT_TARGET_VALUE ${CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT})
! ENDIF(NOT ENV_MACOSX_DEPLOYMENT_TARGET STREQUAL "")
  
  IF(NOT ENV_SDKROOT STREQUAL "")
    SET(CMAKE_OSX_SYSROOT_VALUE ${ENV_SDKROOT})
--- 74,119 ----
  ENDIF(NOT _CMAKE_OSX_SDKS)
  
! EXECUTE_PROCESS(COMMAND sw_vers -productVersion
!   OUTPUT_VARIABLE CURRENT_OSX_VERSION
!   OUTPUT_STRIP_TRAILING_WHITESPACE)
  
! #----------------------------------------------------------------------------
! # _CURRENT_OSX_VERSION - as a two-component string: 10.5, 10.6, ...
! #
! STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
!   _CURRENT_OSX_VERSION "${CURRENT_OSX_VERSION}")
  
! #----------------------------------------------------------------------------
! # CMAKE_OSX_DEPLOYMENT_TARGET
! 
! # Set cache variable - end user may change this during ccmake or cmake-gui configure.
! IF(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
!   SET(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
!     "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
! ENDIF(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
! 
! #----------------------------------------------------------------------------
! # CMAKE_OSX_SYSROOT
! 
! # Environment variable set by the user overrides our default.
! # Use the same environment variable that Xcode uses.
! SET(ENV_SDKROOT "$ENV{SDKROOT}")
! 
! # Set CMAKE_OSX_SYSROOT_DEFAULT based on _CURRENT_OSX_VERSION,
! # accounting for the known specially named SDKs.
! SET(CMAKE_OSX_SYSROOT_DEFAULT
!   "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX${_CURRENT_OSX_VERSION}.sdk")
! 
! IF(_CURRENT_OSX_VERSION STREQUAL "10.4")
    SET(CMAKE_OSX_SYSROOT_DEFAULT
      "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.4u.sdk")
! ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.4")
  
! IF(_CURRENT_OSX_VERSION STREQUAL "10.3")
    SET(CMAKE_OSX_SYSROOT_DEFAULT
      "${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.3.9.sdk")
! ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.3")
  
+ # Use environment or default as initial cache value:
  IF(NOT ENV_SDKROOT STREQUAL "")
    SET(CMAKE_OSX_SYSROOT_VALUE ${ENV_SDKROOT})
***************
*** 115,124 ****
  ENDIF(NOT ENV_SDKROOT STREQUAL "")
  
! # Set cache variables - end user may change these during ccmake or cmake-gui configure.
! IF(CURRENT_OSX_VERSION GREATER 10.3)
!   SET(CMAKE_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET_VALUE} CACHE STRING
!     "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
! ENDIF(CURRENT_OSX_VERSION GREATER 10.3)
! 
  SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH
    "The product will be built against the headers and libraries located inside the indicated SDK.")
--- 122,126 ----
  ENDIF(NOT ENV_SDKROOT STREQUAL "")
  
! # Set cache variable - end user may change this during ccmake or cmake-gui configure.
  SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH
    "The product will be built against the headers and libraries located inside the indicated SDK.")
***************
*** 126,138 ****
  #----------------------------------------------------------------------------
  function(SanityCheckSDKAndDeployTarget _sdk_path _deploy)
!   if (_deploy STREQUAL "")
      return()
    endif()
  
!   string (REGEX REPLACE "(.*MacOSX*)(....)(.*\\.sdk)" "\\2" SDK ${_sdk_path})
!   if (_deploy GREATER SDK)
!     message (FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET (${_deploy}) is greater than CMAKE_OSX_SYSROOT SDK (${_sdk_path}). Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${SDK}")
!   endif (_deploy GREATER SDK)
! endfunction(SanityCheckSDKAndDeployTarget _sdk_path _deploy)
  #----------------------------------------------------------------------------
  
--- 128,144 ----
  #----------------------------------------------------------------------------
  function(SanityCheckSDKAndDeployTarget _sdk_path _deploy)
!   if(_deploy STREQUAL "")
      return()
    endif()
  
!   if(_sdk_path STREQUAL "")
!     message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET='${_deploy}' but CMAKE_OSX_SYSROOT is empty... - either set CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to empty")
!   endif()
! 
!   string(REGEX REPLACE "(.*MacOSX*)(....)(.*\\.sdk)" "\\2" SDK "${_sdk_path}")
!   if(_deploy GREATER "${SDK}")
!     message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET (${_deploy}) is greater than CMAKE_OSX_SYSROOT SDK (${_sdk_path}). Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${SDK} or lower")
!   endif()
! endfunction(SanityCheckSDKAndDeployTarget)
  #----------------------------------------------------------------------------
  

Index: Darwin-GNU-C.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/Darwin-GNU-C.cmake,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C 2 -d -r1.1.2.1 -r1.1.2.2
*** Darwin-GNU-C.cmake	28 Jan 2010 21:47:43 -0000	1.1.2.1
--- Darwin-GNU-C.cmake	11 Feb 2010 15:50:42 -0000	1.1.2.2
***************
*** 2,3 ****
--- 2,4 ----
  __darwin_compiler_gnu(C)
  cmake_gnu_has_isysroot(C)
+ cmake_gnu_set_osx_deployment_target_flag(C)

Index: Darwin-GNU-CXX.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/Darwin-GNU-CXX.cmake,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C 2 -d -r1.1.2.1 -r1.1.2.2
*** Darwin-GNU-CXX.cmake	28 Jan 2010 21:47:43 -0000	1.1.2.1
--- Darwin-GNU-CXX.cmake	11 Feb 2010 15:50:42 -0000	1.1.2.2
***************
*** 2,3 ****
--- 2,4 ----
  __darwin_compiler_gnu(CXX)
  cmake_gnu_has_isysroot(CXX)
+ cmake_gnu_set_osx_deployment_target_flag(CXX)



More information about the Cmake-commits mailing list