2.5 - Start of Make Proxy Operator
[blender.git] / CMakeLists.txt
index 714ec4095af9639a337deec68db1f305ae049bb5..fc6a3d3ade8067a7ea2a3318ec750013ee64dc22 100644 (file)
@@ -63,6 +63,7 @@ OPTION(WITH_OPENEXR           "Enable OpenEXR Support (http://www.openexr.com)"       ON)
 OPTION(WITH_DDS                        "Enable DDS Support"                                    ON)
 OPTION(WITH_FFMPEG             "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
 OPTION(WITH_PYTHON             "Enable Embedded Python API"                            ON)
+OPTION(WITH_SDL                        "Enable SDL for sound and joystick support"                             ON)
 OPTION(WITH_OPENJPEG           "Enable OpenJpeg Support (http://www.openjpeg.org/)"    OFF)
 OPTION(WITH_OPENAL             "Enable OpenAL Support (http://www.openal.org)"         ON)
 OPTION(WITH_OPENMP             "Enable OpenMP (has to be supported by the compiler)"   OFF)
@@ -87,7 +88,7 @@ INCLUDE(CMake/macros.cmake)
 #-----------------------------------------------------------------------------
 #Platform specifics
 
-IF(UNIX)
+IF(UNIX AND NOT APPLE)
   IF(WITH_OPENAL)
     FIND_PACKAGE(OpenAL)
     IF(OPENAL_FOUND)
@@ -133,9 +134,11 @@ IF(UNIX)
   SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
   SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
 
-  FIND_PACKAGE(SDL)
-  SET(SDL_INC ${SDL_INCLUDE_DIR})
-  SET(SDL_LIB ${SDL_LIBRARY})
+  IF(WITH_SDL)
+    FIND_PACKAGE(SDL)
+    SET(SDL_INC ${SDL_INCLUDE_DIR})
+    SET(SDL_LIB ${SDL_LIBRARY})
+  ENDIF(WITH_SDL)
 
   FIND_PATH(OPENEXR_INC
     ImfXdr.h
@@ -177,7 +180,7 @@ IF(UNIX)
   SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement")
 
   INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
-ENDIF(UNIX)
+ENDIF(UNIX AND NOT APPLE)
 
 IF(WIN32)
 
@@ -336,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")  # won't  build with this enabled
+  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")