diff options
author | Brad King <brad.king@kitware.com> | 2012-09-21 18:13:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-21 18:45:53 (GMT) |
commit | 7995722e919c66ff3aad7de73d489bf838af5426 (patch) | |
tree | e2cbe549df7736199331397afae8e376549f9c03 /Modules/Platform | |
parent | 1786b121b40ca0a50a57f44e5e2edef7b9d270ed (diff) | |
download | CMake-7995722e919c66ff3aad7de73d489bf838af5426.zip CMake-7995722e919c66ff3aad7de73d489bf838af5426.tar.gz CMake-7995722e919c66ff3aad7de73d489bf838af5426.tar.bz2 |
OS X: Simplify selection of CMAKE_OSX_ARCHITECTURES
Incremental changes to the logic over time have led to simply
initializing the cache entry with the environment value.
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Darwin.cmake | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 56f340d..f592085 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -77,6 +77,10 @@ execute_process(COMMAND sw_vers -productVersion OUTPUT_VARIABLE CURRENT_OSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) +# Save CMAKE_OSX_ARCHITECTURES from the environment. +set(CMAKE_OSX_ARCHITECTURES "$ENV{CMAKE_OSX_ARCHITECTURES}" CACHE STRING + "Build architectures for OSX") + #---------------------------------------------------------------------------- # _CURRENT_OSX_VERSION - as a two-component string: 10.5, 10.6, ... # @@ -183,29 +187,6 @@ endfunction() # Make sure the combination of SDK and Deployment Target are allowed SanityCheckSDKAndDeployTarget("${CMAKE_OSX_SYSROOT}" "${CMAKE_OSX_DEPLOYMENT_TARGET}") -# set _CMAKE_OSX_MACHINE to uname -m -execute_process(COMMAND uname -m - OUTPUT_STRIP_TRAILING_WHITESPACE - OUTPUT_VARIABLE _CMAKE_OSX_MACHINE) - -# check for Power PC and change to ppc -if(_CMAKE_OSX_MACHINE MATCHES "Power") - set(_CMAKE_OSX_MACHINE ppc) -endif() - -# check for environment variable CMAKE_OSX_ARCHITECTURES -# if it is set. -if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "") - set(CMAKE_OSX_ARCHITECTURES_VALUE "$ENV{CMAKE_OSX_ARCHITECTURES}") -else() - set(CMAKE_OSX_ARCHITECTURES_VALUE "") -endif() - -# now put _CMAKE_OSX_MACHINE into the cache -set(CMAKE_OSX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES_VALUE} CACHE STRING - "Build architectures for OSX") - - if("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$") set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress") |