bugfix [#21230] set-scene animation updates not working
[blender.git] / CMakeLists.txt
index b020284f5483c39b23380b64546fd4c2d9ac5689..8b690cdd81a3c23262a4dc1907c40fdda08a58c5 100644 (file)
@@ -1,4 +1,4 @@
-# $Id$
+ # $Id$
 # ***** BEGIN GPL LICENSE BLOCK *****
 #
 # This program is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # The Original Code is Copyright (C) 2006, Blender Foundation
 # All rights reserved.
@@ -70,7 +70,6 @@ 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)
 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)
@@ -82,27 +81,25 @@ OPTION(WITH_BUILDINFO     "Include extra build details" ON)
 OPTION(WITH_INSTALL       "Install accompanying scripts and language files needed to run blender" ON)
 OPTION(WITH_OPENCOLLADA                "Enable OpenCollada Support (http://www.opencollada.org/)"      ON)
 
+# Unix defaults to OpenMP On
+IF(UNIX AND NOT APPLE)
+       OPTION(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" ON)
+ELSE()
+       OPTION(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" OFF)
+ENDIF()
+
+OPTION(WITH_RAYOPTIMIZATION    "Enable use of SIMD (SSE) optimizations for the raytracer" OFF) 
+
 IF (APPLE)
-OPTION(WITH_COCOA        "Use Cocoa framework instead of deprecated Carbon" ON)
-OPTION(WITH_LIBS10.5     "Use 10.5 libs (needed for 64bit builds)" OFF)
+       OPTION(WITH_COCOA         "Use Cocoa framework instead of deprecated Carbon" ON)
+       OPTION(USE_QTKIT          "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
+       OPTION(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)
 ENDIF (APPLE)
 
 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
        MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
 ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
 
-IF (WITH_OPENCOLLADA AND NOT APPLE)
-SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
-SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA})
-SET(OPENCOLLADA_LIB OpenCollada)
-SET(PCRE /usr CACHE FILEPATH "PCRE Directory")
-SET(PCRE_LIBPATH ${PCRE}/lib)
-SET(PCRE_LIB pcre)
-SET(EXPAT /usr CACHE FILEPATH "Expat Directory")
-SET(EXPAT_LIBPATH ${EXPAT}/lib)
-SET(EXPAT_LIB expat)
-ENDIF (WITH_OPENCOLLADA AND NOT APPLE)
-
 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
 # On Unix: 
 #   cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
@@ -119,6 +116,8 @@ INCLUDE(CMake/macros.cmake)
 #Platform specifics
 
 IF(UNIX AND NOT APPLE)
+
+
        IF(WITH_OPENAL)
                FIND_PACKAGE(OpenAL)
                IF(OPENAL_FOUND)
@@ -182,11 +181,12 @@ IF(UNIX AND NOT APPLE)
                ENDIF(NOT SDL_FOUND)
        ENDIF(WITH_SDL)
 
+    SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
        FIND_PATH(OPENEXR_INC
                ImfXdr.h
                PATHS
+        ${OPENEXR}/include/OpenEXR
                /usr/local/include/OpenEXR
-               /usr/include/OpenEXR
                /sw/include/OpenEXR
                /opt/local/include/OpenEXR
                /opt/csw/include/OpenEXR
@@ -194,9 +194,9 @@ IF(UNIX AND NOT APPLE)
        )
        SET(OPENEXR_LIB Half IlmImf Iex Imath)
 
-       SET(FFMPEG /usr)
+       SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
        SET(FFMPEG_INC ${FFMPEG}/include)
-       SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale)
+       SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
        SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
   
        IF(WITH_FFTW3)
@@ -217,6 +217,20 @@ IF(UNIX AND NOT APPLE)
 
        FIND_PACKAGE(ZLIB REQUIRED)
 
+       IF (WITH_OPENCOLLADA)
+               SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
+               SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
+               SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer)
+               SET(OPENCOLLADA_INC ${OPENCOLLADA})
+               SET(PCRE /usr CACHE FILEPATH "PCRE Directory")
+               SET(PCRE_LIBPATH ${PCRE}/lib)
+               SET(PCRE_LIB pcre)
+               SET(EXPAT /usr CACHE FILEPATH "Expat Directory")
+               SET(EXPAT_LIBPATH ${EXPAT}/lib)
+               SET(EXPAT_LIB expat)
+       ENDIF (WITH_OPENCOLLADA)
+
+
        # Could use ${X11_Xinput_LIB} ${X11_X11_LIB} too
        SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11")
 
@@ -232,12 +246,12 @@ IF(UNIX AND NOT APPLE)
        ENDIF(WITH_OPENMP)
 
 
-       SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts")
+       SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -Wno-char-subscripts")
 
        SET(PLATFORM_LINKFLAGS "-pthread")
 
        # Better warnings
-       SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement")
+       SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -Wno-unknown-pragmas")
        SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
 
        INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
@@ -263,15 +277,10 @@ IF(WIN32)
        SET(PYTHON_LIB python31)
        SET(PYTHON_LIBPATH ${PYTHON}/lib)
 
-       IF(CMAKE_CL_64)
-               SET(WITH_OPENAL OFF)
-       ELSE(CMAKE_CL_64)
-               #SET(WITH_OPENAL ON)
-               SET(OPENAL ${LIBDIR}/openal)
-               SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
-               SET(OPENAL_LIBRARY wrap_oal)
-               SET(OPENAL_LIBPATH ${OPENAL}/lib)
-       ENDIF(CMAKE_CL_64)
+       SET(OPENAL ${LIBDIR}/openal)
+       SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
+       SET(OPENAL_LIBRARY wrap_oal)
+       SET(OPENAL_LIBPATH ${OPENAL}/lib)
 
        IF(WITH_JACK)
                SET(JACK ${LIBDIR}/jack)
@@ -400,6 +409,16 @@ IF(WIN32)
   
        SET(WINTAB_INC ${LIBDIR}/wintab/include) 
 
+       SET(OPENCOLLADA ${LIBDIR}/opencollada)
+       SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
+       SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
+       SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa)
+       #pcre is bundled with openCollada
+       #SET(PCRE ${LIBDIR}/pcre)
+       #SET(PCRE_LIBPATH ${PCRE}/lib)
+       SET(PCRE_LIB pcre)
+
+
        IF(CMAKE_CL_64)
                SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
        ELSE(CMAKE_CL_64)
@@ -416,7 +435,7 @@ IF(APPLE)
                IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
                        SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
                ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
-                       SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
+                       SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.0.0-powerpc)
                ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
        ENDIF(WITH_LIBS10.5)
        
@@ -485,7 +504,7 @@ IF(APPLE)
 
        SET(ZLIB /usr)
        SET(ZLIB_INC "${ZLIB}/include")
-       SET(ZLIB_LIBRARIES z)
+       SET(ZLIB_LIBRARIES z bz2)
 
        SET(FREETYPE ${LIBDIR}/freetype)
        SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
@@ -498,8 +517,8 @@ IF(APPLE)
        SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
 
        SET(FFMPEG ${LIBDIR}/ffmpeg)
-       SET(FFMPEG_INC ${CMAKE_SOURCE_DIR}/extern/ffmpeg)
-       SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore)
+       SET(FFMPEG_INC ${FFMPEG}/include)
+       SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
        SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
 
        SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
@@ -510,32 +529,42 @@ 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")
+               SET(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
+               SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio")
+               IF(USE_QTKIT)
+                       SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DUSE_QTKIT")
+                       SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
+                       IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+                               SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
+                               #libSDL still needs 32bit carbon quicktime 
+                       ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+               ELSEIF(WITH_QUICKTIME)
+                       SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
+               ENDIF(USE_QTKIT)
        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")
+               SET(PLATFORM_CFLAGS "-pipe -funsigned-char")
+               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 ")
-               SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
+               SET(LLIBS "${LLIBS} -lgomp")
+               SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
+               SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
        ENDIF(WITH_OPENMP)
 
        IF (WITH_OPENCOLLADA)
                SET(OPENCOLLADA ${LIBDIR}/opencollada)
                SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
                SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
-               SET(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2" )
+               SET(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa" )
                #pcre is bundled with openCollada
                #SET(PCRE ${LIBDIR}/pcre)
                #SET(PCRE_LIBPATH ${PCRE}/lib)
                SET(PCRE_LIB pcre)
-               #native OSX libxml2 is used
+               #libxml2 is used
                #SET(EXPAT ${LIBDIR}/expat)
                #SET(EXPAT_LIBPATH ${EXPAT}/lib)
-               #SET(EXPAT_LIB expat)
+               SET(EXPAT_LIB)
        ENDIF (WITH_OPENCOLLADA)
 
        SET(SDL ${LIBDIR}/sdl)
@@ -555,6 +584,24 @@ IF(APPLE)
        SET(TIFF_INC ${TIFF}/include)
 
        SET(EXETYPE MACOSX_BUNDLE)
+
+       SET(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
+       SET(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
+       IF(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
+               SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
+               SET(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
+       ELSEIF(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
+               SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
+               SET(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
+       ELSE(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
+               SET(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
+               SET(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
+       ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
+
+       # Better warnings
+       SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -Wno-unknown-pragmas")
+       SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
+
 ENDIF(APPLE)
 
 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
@@ -638,4 +685,3 @@ ADD_SUBDIRECTORY(source/creator)
 IF(WITH_PLAYER)
        ADD_SUBDIRECTORY(source/blenderplayer)
 ENDIF(WITH_PLAYER)
-