* Updated CMake files to build with Python 3.1 on OS X by default. Remember to update...
authorMatt Ebb <matt@mke3.net>
Wed, 22 Jul 2009 12:43:37 +0000 (12:43 +0000)
committerMatt Ebb <matt@mke3.net>
Wed, 22 Jul 2009 12:43:37 +0000 (12:43 +0000)
CMakeLists.txt

index 47daa1e4b9eed92acc97e4359e58e5f23a6f8a6b..b6b0ea2e5e945d8499b3990015f30dd9de3acb63 100644 (file)
@@ -339,17 +339,29 @@ IF(APPLE)
     ENDIF(OPENAL_FOUND)
   ENDIF(WITH_OPENAL)
 
-  SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
-  SET(PYTHON_VERSION 2.5)
-  SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
-  SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
-  SET(PYTHON_LIB "")
-  SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
-  IF(CMAKE_SYSTEM_VERSION GREATER 10.4)
-       SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
-  ELSE(CMAKE_SYSTEM_VERSION GREATER 10.4)
+
+  SET(PYTHON_VERSION 3.1)
+
+  IF(PYTHON_VERSION MATCHES 3.1)
+    # we use precompiled libraries for py 3.1 and up by default
+
+    SET(PYTHON ${LIBDIR}/python)
+    SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
+    SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "")
+    SET(PYTHON_LIB python${PYTHON_VERSION})
+    SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "")
+    SET(PYTHON_LINKFLAGS "-u _PyMac_Error")
+  ELSE(PYTHON_VERSION MATCHES 3.1)
+    # otherwise, use custom system framework
+
+    SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
+    SET(PYTHON_VERSION 2.5)
+    SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
+    SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
+    SET(PYTHON_LIB "")
+    SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
     SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
-  ENDIF(CMAKE_SYSTEM_VERSION GREATER 10.4)
+  ENDIF(PYTHON_VERSION MATCHES 3.1)
 
   SET(GETTEXT ${LIBDIR}/gettext)
   SET(GETTEXT_INC "${GETTEXT}/include")