svn merge -r40166:40279 ^/trunk/blender
[blender.git] / source / creator / CMakeLists.txt
index 6a701129fd1fba5efe60871b7b2194a0d743b547..22fe0a1a1d1f2ab465675dba64a54caf71315518 100644 (file)
@@ -25,9 +25,6 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-# So BUILDINFO and BLENDERPATH strings are automatically quoted
-cmake_policy(SET CMP0005 NEW)
-
 setup_libdirs()
 
 blender_include_dirs(
@@ -81,6 +78,10 @@ if(WITH_PYTHON)
        endif()
 endif()
 
+if(WITH_HEADLESS)
+       add_definitions(-DWITH_HEADLESS)
+endif()
+
 if(WITH_GAMEENGINE)
        blender_include_dirs(../gameengine/BlenderRoutines)
 
@@ -93,7 +94,7 @@ endif()
 
 if(WITH_BINRELOC)
        add_definitions(-DWITH_BINRELOC)
-       blender_include_dirs(${BINRELOC_INC})
+       blender_include_dirs(${BINRELOC_INCLUDE_DIRS})
 endif()
 
 # Setup the exe sources and buildinfo
@@ -132,6 +133,7 @@ if(WIN32 AND NOT UNIX)
 endif()
 
 if(WITH_BUILDINFO)
+       add_definitions(-DWITH_BUILDINFO)
        # --------------------------------------------------------------------------
        # These defines could all be moved into the header below
        string(REPLACE " " "\ " BUILDINFO_CFLAGS "${CMAKE_C_FLAGS}")
@@ -191,10 +193,10 @@ if(WITH_PYTHON_MODULE)
        set_target_properties(
                blender
                PROPERTIES
-                               PREFIX ""
-                               OUTPUT_NAME bpy
-                               LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
-                               RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin  # only needed on windows
+                       PREFIX ""
+                       OUTPUT_NAME bpy
+                       LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
+                       RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin  # only needed on windows
        )
        
        if(WIN32)
@@ -227,7 +229,17 @@ else()
        set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH})
 endif()
 
-# install target
+
+# -----------------------------------------------------------------------------
+# Install Targets
+
+set(BLENDER_TEXT_FILES
+       ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
+       ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
+       ${CMAKE_SOURCE_DIR}/release/text/copyright.txt
+       ${CMAKE_SOURCE_DIR}/release/text/readme.html
+)
+
 if(UNIX AND NOT APPLE)
 
        if(WITH_INSTALL_PORTABLE)
@@ -257,9 +269,9 @@ if(UNIX AND NOT APPLE)
        if(WITH_INSTALL_PORTABLE)
                install(
                        FILES
-                       ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
-                       ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
-                       ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1
+                               ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
+                               ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
+                               ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1
                        DESTINATION ${TARGETDIR}
                )
 
@@ -270,9 +282,8 @@ if(UNIX AND NOT APPLE)
                )
 
                install(
-                       DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
+                       FILES ${BLENDER_TEXT_FILES}
                        DESTINATION ${TARGETDIR}
-                       PATTERN ".svn" EXCLUDE
                )
 
        else()
@@ -305,12 +316,12 @@ if(UNIX AND NOT APPLE)
                )
                install(
                        DIRECTORY
-                                       ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/16x16
-                                       ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/22x22
-                                       ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/24x24
-                                       ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32
-                                       ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48
-                                       ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256
+                               ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/16x16
+                               ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/22x22
+                               ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/24x24
+                               ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32
+                               ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48
+                               ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256
                        DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
                        PATTERN ".svn" EXCLUDE
                        PATTERN "*.svg" EXCLUDE
@@ -328,21 +339,20 @@ if(UNIX AND NOT APPLE)
                        DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
                )
                install(
-                       DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
+                       FILES ${BLENDER_TEXT_FILES}
                        DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
-                       PATTERN ".svn" EXCLUDE
                )
        endif()
 
        install(
                FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf
-               DESTINATION ${TARGETDIR_VER}/config
+               DESTINATION ${TARGETDIR_VER}
        )
 
        if(WITH_INTERNATIONAL)
                install(
                        FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages
-                       DESTINATION ${TARGETDIR_VER}/config
+                       DESTINATION ${TARGETDIR_VER}
                )
 
                install(
@@ -405,20 +415,19 @@ elseif(WIN32)
        )
 
        install(  # same as linux!, deduplicate
-               DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
+               FILES ${BLENDER_TEXT_FILES}
                DESTINATION ${TARGETDIR}
-               PATTERN ".svn" EXCLUDE
        )
 
        install(  # same as linux!, deduplicate
                FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf
-               DESTINATION ${TARGETDIR_VER}/config
+               DESTINATION ${TARGETDIR_VER}
        )
 
        if(WITH_INTERNATIONAL) # same as linux!, deduplicate
                install(
                        FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages
-                       DESTINATION ${TARGETDIR_VER}/config
+                       DESTINATION ${TARGETDIR_VER}
                )
                install(
                        DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
@@ -426,12 +435,12 @@ elseif(WIN32)
                        PATTERN ".svn" EXCLUDE
                )
 
-               if(NOT CMAKE_CL_64)
-                       install(
-                               FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll
-                               DESTINATION ${TARGETDIR}
-                       )
+               install(
+                       FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll
+                       DESTINATION ${TARGETDIR}
+               )
 
+               if(NOT CMAKE_CL_64)
                        install(
                                FILES ${LIBDIR}/iconv/lib/iconv.dll
                                DESTINATION ${TARGETDIR}
@@ -515,8 +524,8 @@ elseif(WIN32)
        else()
                install(
                        FILES
-                       ${LIBDIR}/png/lib/libpng.dll
-                       ${LIBDIR}/zlib/lib/zlib.dll
+                               ${LIBDIR}/png/lib/libpng.dll
+                               ${LIBDIR}/zlib/lib/zlib.dll
                        DESTINATION ${TARGETDIR}
                )
        endif()
@@ -536,11 +545,11 @@ elseif(WIN32)
        if(WITH_CODEC_FFMPEG)
                install(
                        FILES
-                       ${LIBDIR}/ffmpeg/lib/avcodec-52.dll
-                       ${LIBDIR}/ffmpeg/lib/avformat-52.dll
-                       ${LIBDIR}/ffmpeg/lib/avdevice-52.dll
-                       ${LIBDIR}/ffmpeg/lib/avutil-50.dll
-                       ${LIBDIR}/ffmpeg/lib/swscale-0.dll
+                               ${LIBDIR}/ffmpeg/lib/avcodec-53.dll
+                               ${LIBDIR}/ffmpeg/lib/avformat-53.dll
+                               ${LIBDIR}/ffmpeg/lib/avdevice-53.dll
+                               ${LIBDIR}/ffmpeg/lib/avutil-51.dll
+                               ${LIBDIR}/ffmpeg/lib/swscale-2.dll
                        DESTINATION ${TARGETDIR}
                )
 
@@ -548,8 +557,7 @@ elseif(WIN32)
 
        if(WITH_CODEC_SNDFILE)
                install(
-                       FILES
-                       ${LIBDIR}/sndfile/lib/libsndfile-1.dll
+                       FILES ${LIBDIR}/sndfile/lib/libsndfile-1.dll
                        DESTINATION ${TARGETDIR}
                )
        endif()
@@ -557,8 +565,8 @@ elseif(WIN32)
        if(WITH_OPENAL)
                install(
                        FILES
-                       ${LIBDIR}/openal/lib/OpenAL32.dll
-                       ${LIBDIR}/openal/lib/wrap_oal.dll
+                               ${LIBDIR}/openal/lib/OpenAL32.dll
+                               ${LIBDIR}/openal/lib/wrap_oal.dll
                        DESTINATION ${TARGETDIR}
                )
        endif()
@@ -566,8 +574,7 @@ elseif(WIN32)
        if(WITH_SDL)
                if(NOT CMAKE_CL_64)
                        install(
-                               FILES
-                               ${LIBDIR}/sdl/lib/SDL.dll
+                               FILES ${LIBDIR}/sdl/lib/SDL.dll
                                DESTINATION ${TARGETDIR}
                        )
                endif()
@@ -575,14 +582,12 @@ elseif(WIN32)
 
        if(NOT CMAKE_CL_64)
                install(
-                       FILES
-                       ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
+                       FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
                        DESTINATION ${TARGETDIR}
                )
        else()
                install(
-                       FILES
-                       ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
+                       FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
                        DESTINATION ${TARGETDIR}
                )
        endif()
@@ -630,9 +635,9 @@ elseif(APPLE)
        endmacro()
 
        # install release and app files
-       install_dir(
-               ${CMAKE_SOURCE_DIR}/release/text/
-               \${TARGETDIR}
+       install(
+               FILES ${BLENDER_TEXT_FILES}
+               DESTINATION ${TARGETDIR}
        )
 
        install(
@@ -647,7 +652,7 @@ elseif(APPLE)
 
        install(
                FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf
-               DESTINATION ${TARGETDIR_VER}/datafiles
+               DESTINATION ${TARGETDIR_VER}
        )
 
        # localization
@@ -697,17 +702,26 @@ elseif(APPLE)
        endif()
 endif()
 
+unset(BLENDER_TEXT_FILES)
+
+
+# -----------------------------------------------------------------------------
+# Setup link libs
+
 add_dependencies(blender makesdna)
 
 get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
 
-set(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_render)
+set(BLENDER_LINK_LIBS
+       ${BLENDER_LINK_LIBS}
+       bf_windowmanager
+       bf_render
+)
 
 if(WITH_MOD_FLUID)
        list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
 endif()
 
-
 #if(UNIX)
        # Sort libraries
        set(BLENDER_SORTED_LIBS
@@ -755,7 +769,9 @@ endif()
                bf_intern_opennl
                bf_python
                bf_python_ext
+               bf_python_mathutils
                bf_ikplugin
+               bf_bmesh
                bf_modifiers
                bf_blenkernel
                bf_nodes
@@ -787,6 +803,7 @@ endif()
                extern_minilzo
                extern_lzma
                ge_logic_ketsji
+               extern_recastnavigation
                ge_phys_common
                ge_logic
                ge_rasterizer
@@ -794,7 +811,6 @@ endif()
                ge_logic_expressions
                ge_scenegraph
                ge_logic_network
-               bf_python # duplicate for BPY_driver_exec
                ge_logic_ngnetwork
                extern_bullet
                ge_logic_loopbacknetwork
@@ -851,6 +867,12 @@ endif()
                message(STATUS "Blender Skipping: (${REM_MSG})")
        endif()
        target_link_libraries(blender ${BLENDER_SORTED_LIBS})
+       
+       unset(SEARCHLIB)
+       unset(SORTLIB)
+       unset(REMLIB)
+       unset(REM_MSG)
+       
 #else()
 #      target_link_libraries(blender ${BLENDER_LINK_LIBS})
 #endif()