From 7995722e919c66ff3aad7de73d489bf838af5426 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 21 Sep 2012 14:13:06 -0400 Subject: 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. --- Modules/Platform/Darwin.cmake | 27 ++++----------------------- 1 file 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") -- cgit v0.12