Skip to content

Commit

Permalink
Fixed the CMakeLists.txt to have correct default values for CMAKE_OSX…
Browse files Browse the repository at this point in the history
…_SYSROOT, also changed the minimum CMAKE version required
  • Loading branch information
Sachin Srivastava committed Jun 19, 2012
1 parent c92a8fd commit 4325189
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
################################################################################
# Initial setup
################################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)

IF(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW)
Expand All @@ -18,25 +18,20 @@ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
IF(APPLE)
# Setup default values
IF(NOT HAVE_CACHED_VALUES)
IF(EXISTS /Developer/SDKs/MacOSX10.6.sdk)
SET(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk" CACHE FILEPATH "isysroot used for universal binary support" FORCE)
ELSE()
IF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk" CACHE FILEPATH "isysroot used for universal binary support" FORCE)
ELSE()
IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk" CACHE FILEPATH "isysroot used for universal binary support" FORCE)
ELSE()
MESSAGE(FATAL_ERROR "No supported SDK could be found!")
ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
ENDIF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
ENDIF(EXISTS /Developer/SDKs/MacOSX10.6.sdk)
ENDIF(NOT HAVE_CACHED_VALUES)

# Target Tiger
IF(EXISTS ${CMAKE_OSX_SYSROOT})
SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT} CACHE FILEPATH "isysroot used for universal binary support" FORCE)
ENDIF(EXISTS ${CMAKE_OSX_SYSROOT})

IF(NOT ${CMAKE_OSX_ARCHITECTURES} STREQUAL "")
SET(CMAKE_OSX_ARCHITECTURES ${CMAKE_OSX_ARCHITECTURES} CACHE STRING "Build architectures for OSX" FORCE)
ELSE()
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
ENDIF(NOT ${CMAKE_OSX_ARCHITECTURES} STREQUAL "")

ENDIF(NOT HAVE_CACHED_VALUES)

# Target Tiger
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4")
ENDIF(APPLE)

Expand Down

0 comments on commit 4325189

Please sign in to comment.