r14453 by cbradney - Backport the Snow Leopard detection to 1.3.6svn

scribus-commit scribus-commit at lists.scribus.net
Fri Jan 1 19:55:15 CET 2010


Revision: 14453
Author: cbradney
Date: 2010-01-01T06:16:05.865506Z
Commit message: Backport the Snow Leopard detection to 1.3.6svn

Changeset: 
M  /branches/Version135/Scribus/CMakeLists.txt

Diffs:
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 14452)
+++ CMakeLists.txt	(revision 14453)
@@ -96,11 +96,18 @@
     OUTPUT_STRIP_TRAILING_WHITESPACE
 )
 
+MESSAGE(STATUS  "Machine: ${MACHINE}, void pointer size: ${CMAKE_SIZEOF_VOID_P}")
 STRING(REGEX MATCH "(i?86-*)|(athlon-*)|(pentium-*)" _machine_x86 "${MACHINE}")
 IF (_machine_x86)
     MESSAGE(STATUS "Found target X86")
     SET(ARCH_X86 1)
 ENDIF (_machine_x86)
+IF (APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND ARCH_X86 EQUAL 1)
+  MESSAGE(STATUS "Found Snow Leopard Target: Apple, 64 bit, X86")
+  UNSET(ARCH_X86)
+  SET(ARCH_X86_64 1)
+  SET(APPLE_10_6_X 1 CACHE TYPE BOOL)
+ENDIF (APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND ARCH_X86 EQUAL 1)
 
 STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _machine_x86_64 "${MACHINE}")
 IF (_machine_x86_64)
@@ -339,6 +346,11 @@
 
 #Based on our build type, setup our build options
 IF(APPLE)
+  IF(APPLE_10_6_X)
+    SET(OSXMINVER "10.6" CACHE TYPE STRING)
+  ELSEIF (APPLE_10_6_X)
+    SET(OSXMINVER "10.4" CACHE TYPE STRING)
+  ENDIF(APPLE_10_6_X)
   # gcc/mac
   IF(WANT_UNIVERSAL_BUNDLE)
     MESSAGE("Setting Universal (PPC/i386) Architecture for OSX Build/Bundle")
@@ -351,26 +363,32 @@
       SET(CMAKE_OSX_ARCHITECTURES "ppc" )
       SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "ppc" )
     ELSE(ARCH_PPC OR ARCH_PPC_64)
-      MESSAGE("Setting i386 Architecture for OSX Build/Bundle")
-      SET(CMAKE_OSX_ARCHITECTURES "i386" )
-      SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "i386" )   
+      IF(APPLE_10_6_X)
+        MESSAGE("Setting x86_64 Architecture for OSX Build/Bundle")
+        SET(CMAKE_OSX_ARCHITECTURES "x86_64" )
+        SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "x86_64" )
+      ELSE(APPLE_10_6_X)
+        MESSAGE("Setting i386 Architecture for OSX Build/Bundle")
+        SET(CMAKE_OSX_ARCHITECTURES "i386" )
+        SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "i386" )
+      ENDIF(APPLE_10_6_X)
     ENDIF(ARCH_PPC OR ARCH_PPC_64)
   ENDIF(WANT_UNIVERSAL_BUNDLE)
   MESSAGE(STATUS "${CMAKE_OSX_ARCHITECTURES} ${CMAKE_OSX_SYSROOT}")
-  SET( ENV{MACOSX_DEPLOYMENT_TARGET} 10.4 ) 
+  SET(ENV{MACOSX_DEPLOYMENT_TARGET} ${OSXMINVER} )
   SET( ENV{LD_PREBIND} 1 )
   SET( ENV{LD_PREBIND_ALLOW_OVERLAP} 1 )
   IF (WANT_DEBUG)
-	SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
-	SET(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
+    SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
+    SET(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
   ENDIF (WANT_DEBUG)
   IF (WANT_RELEASEWITHDEBUG)
-	SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g3 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
-	SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g3 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
+    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g3 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
+    SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g3 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
   ENDIF (WANT_RELEASEWITHDEBUG)
   IF (NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
-	SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
-	SET(CMAKE_C_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=10.4")
+    SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
+    SET(CMAKE_C_FLAGS_RELEASE "-O2 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
   ENDIF (NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
 ELSE(APPLE)
   IF(${CMAKE_GENERATOR} MATCHES "^(Visual Studio|NMake).*")




More information about the scribus-commit mailing list