summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-03-24 14:15:05 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-03-24 14:15:05 (GMT)
commitf7c1723135f140eaac1ee02c31c0339761778f22 (patch)
treeae4858167f38f2e57c3dcf442fbfe83aeea1cc82 /Modules
parentcec6543d0d7e0f8302b092f3ff66fb240bc212c4 (diff)
downloadCMake-f7c1723135f140eaac1ee02c31c0339761778f22.zip
CMake-f7c1723135f140eaac1ee02c31c0339761778f22.tar.gz
CMake-f7c1723135f140eaac1ee02c31c0339761778f22.tar.bz2
ENH: add support for universal binaries
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Darwin.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 1c49198..7d18906 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -11,6 +11,29 @@ SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_name
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
+# setup for universal binaries if sysroot exists
+IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+ # set the sysroot to be used if CMAKE_OSX_ARCHITECTURES
+ # has more than one value
+ SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk CACHE STRING
+ "isysroot used for universal binary support")
+ # set _CMAKE_OSX_MACHINE to umame -m
+ EXEC_PROGRAM(uname ARGS -m 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("${_CMAKE_OSX_MACHINE}" MATCHES "Power")
+ # check for environment variable CMAKE_OSX_ARCHITECTURES
+ # if it is set.
+ IF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+ SET(_CMAKE_OSX_MACHINE "$ENV{CMAKE_OSX_ARCHITECTURES}")
+ ENDIF(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
+ # now put _CMAKE_OSX_MACHINE into the cache
+ SET(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}
+ CACHE STRING "Build architectures for OSX")
+ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+
+
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")