summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-09-21 18:13:06 (GMT)
committerBrad King <brad.king@kitware.com>2012-09-21 18:45:53 (GMT)
commit7995722e919c66ff3aad7de73d489bf838af5426 (patch)
treee2cbe549df7736199331397afae8e376549f9c03 /Modules
parent1786b121b40ca0a50a57f44e5e2edef7b9d270ed (diff)
downloadCMake-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')
-rw-r--r--Modules/Platform/Darwin.cmake27
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")