Smoke:
[blender.git] / CMakeLists.txt
index c881dec03dbb7dcaf5f1245443a16a9513a1d453..d53f4ed99664361c3e302a5e00984e74ff3c2acd 100644 (file)
@@ -51,6 +51,10 @@ PROJECT(Blender)
 SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
 SET(LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/lib)
 
+# Note! - Could create this from the blender version string
+# ...but thats quite involved, make sure this matches the blender version.
+SET(BLENDER_VERSION  2.5)
+
 #-----------------------------------------------------------------------------
 # Set default config options
 OPTION(WITH_PLAYER        "Build Player" OFF)
@@ -71,10 +75,16 @@ OPTION(WITH_WEBPLUGIN     "Enable Web Plugin (Unix only)" OFF)
 OPTION(WITH_FFTW3         "Enable FFTW3 support" OFF)
 OPTION(WITH_JACK          "Enable Jack Support (http://www.jackaudio.org)" OFF)
 OPTION(WITH_SNDFILE       "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
+OPTION(WITH_LZO           "Enable fast LZO compression, used for pointcache" ON)
+OPTION(WITH_LZMA          "Enable best LZMA compression, used for pointcache" ON)
 OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
-OPTION(WITH_BUILDINFO     "Include extra build details" ON)
+OPTION(WITH_BUILDINFO     "Include extra build details" ON)
 OPTION(WITH_INSTALL       "Install accompanying scripts and language files needed to run blender" ON)
 
+IF (APPLE)
+OPTION(WITH_COCOA        "Use Cocoa framework instead of deprecated Carbon" OFF)
+ENDIF (APPLE)
+
 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
        MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
 ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
@@ -396,6 +406,7 @@ IF(APPLE)
                FIND_PACKAGE(OpenAL)
                IF(OPENAL_FOUND)
                        SET(WITH_OPENAL ON)
+                       SET(OPENAL_INCLUDE_DIR "${OPENAL_INCLUDE_DIR};${LIBDIR}/openal/include")
                ELSE(OPENAL_FOUND)
                        SET(WITH_OPENAL OFF)
                ENDIF(OPENAL_FOUND)
@@ -479,9 +490,13 @@ IF(APPLE)
 
        SET(LLIBS stdc++ SystemStubs)
 
+       IF (WITH_COCOA)
+       SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DGHOST_COCOA")
+       SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
+       ELSE (WITH_COCOA)
        SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
        SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
-
+       ENDIF (WITH_COCOA)
        IF(WITH_OPENMP)
                SET(LLIBS "${LLIBS} -lgomp ")
                SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
@@ -513,15 +528,15 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
 
 
-# TODO - buildinfo
-IF(UNIX)
-#   IF(WITH_BUILDINFO)
-#     EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
-#     EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)  
-#     EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
-#     SET(BUILD_TYPE ${CMAKE_BUILD_TYPE})
-#   ENDIF(WITH_BUILDINFO)
-ENDIF(UNIX)
+# buildinfo
+IF(UNIX)
+       IF(WITH_BUILDINFO)
+               EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
+               EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)  
+               EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
+               # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
+       ENDIF(WITH_BUILDINFO)
+ENDIF(UNIX)
 
 #-----------------------------------------------------------------------------
 # Common.