diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b45749..69da7b2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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)