2006-11-17 02:27:12 +00:00
|
|
|
MACRO(BLENDERLIB_NOLIST
|
|
|
|
name
|
|
|
|
sources
|
|
|
|
includes)
|
|
|
|
|
|
|
|
# Gather all headers
|
|
|
|
FILE(GLOB_RECURSE INC_ALL *.h)
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(${includes})
|
|
|
|
ADD_LIBRARY(${name} ${INC_ALL} ${sources})
|
|
|
|
|
|
|
|
# Group by location on disk
|
|
|
|
SOURCE_GROUP(Files FILES CMakeLists.txt)
|
|
|
|
SET(ALL_FILES ${sources} ${INC_ALL})
|
|
|
|
FOREACH(SRC ${ALL_FILES})
|
|
|
|
STRING(REGEX REPLACE ${CMAKE_CURRENT_SOURCE_DIR} "Files" REL_DIR "${SRC}")
|
|
|
|
STRING(REGEX REPLACE "[\\\\/][^\\\\/]*$" "" REL_DIR "${REL_DIR}")
|
|
|
|
STRING(REGEX REPLACE "^[\\\\/]" "" REL_DIR "${REL_DIR}")
|
|
|
|
IF(REL_DIR)
|
|
|
|
SOURCE_GROUP(${REL_DIR} FILES ${SRC})
|
|
|
|
ELSE(REL_DIR)
|
|
|
|
SOURCE_GROUP(Files FILES ${SRC})
|
|
|
|
ENDIF(REL_DIR)
|
|
|
|
ENDFOREACH(SRC)
|
|
|
|
|
|
|
|
MESSAGE(STATUS "Configuring library ${name}")
|
|
|
|
ENDMACRO(BLENDERLIB_NOLIST)
|
|
|
|
|
|
|
|
MACRO(BLENDERLIB
|
|
|
|
name
|
|
|
|
sources
|
|
|
|
includes)
|
|
|
|
|
|
|
|
BLENDERLIB_NOLIST(${name} "${sources}" "${includes}")
|
|
|
|
|
|
|
|
# Add to blender's list of libraries
|
2006-12-07 00:18:57 +00:00
|
|
|
FILE(APPEND ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "${name};")
|
2006-11-17 02:27:12 +00:00
|
|
|
ENDMACRO(BLENDERLIB)
|
|
|
|
|
|
|
|
MACRO(SETUP_LIBDIRS)
|
2008-08-25 15:33:18 +00:00
|
|
|
# see "cmake --help-policy CMP0003"
|
2008-09-05 21:57:34 +00:00
|
|
|
if(COMMAND cmake_policy)
|
|
|
|
CMAKE_POLICY(SET CMP0003 NEW)
|
|
|
|
endif(COMMAND cmake_policy)
|
2009-08-17 18:07:40 +00:00
|
|
|
|
|
|
|
LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
|
|
|
|
|
|
|
|
IF(WITH_PYTHON)
|
|
|
|
LINK_DIRECTORIES(${PYTHON_LIBPATH})
|
|
|
|
ENDIF(WITH_PYTHON)
|
2006-11-17 02:27:12 +00:00
|
|
|
IF(WITH_INTERNATIONAL)
|
2009-08-14 17:16:16 +00:00
|
|
|
LINK_DIRECTORIES(${ICONV_LIBPATH})
|
2006-11-17 02:27:12 +00:00
|
|
|
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
|
|
|
|
ENDIF(WITH_INTERNATIONAL)
|
2009-08-14 17:16:16 +00:00
|
|
|
IF(WITH_SDL)
|
|
|
|
LINK_DIRECTORIES(${SDL_LIBPATH})
|
|
|
|
ENDIF(WITH_SDL)
|
2009-08-17 18:07:40 +00:00
|
|
|
IF(WITH_FFMPEG)
|
|
|
|
LINK_DIRECTORIES(${FFMPEG_LIBPATH})
|
|
|
|
ENDIF(WITH_FFMPEG)
|
|
|
|
IF(WITH_OPENEXR)
|
|
|
|
LINK_DIRECTORIES(${OPENEXR_LIBPATH})
|
|
|
|
ENDIF(WITH_OPENEXR)
|
|
|
|
IF(WITH_QUICKTIME)
|
|
|
|
LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
|
|
|
|
ENDIF(WITH_QUICKTIME)
|
2006-11-17 02:27:12 +00:00
|
|
|
IF(WITH_OPENAL)
|
|
|
|
LINK_DIRECTORIES(${OPENAL_LIBPATH})
|
|
|
|
ENDIF(WITH_OPENAL)
|
2009-08-16 14:53:11 +00:00
|
|
|
IF(WITH_JACK)
|
|
|
|
LINK_DIRECTORIES(${JACK_LIBPATH})
|
|
|
|
ENDIF(WITH_JACK)
|
2009-08-21 19:39:28 +00:00
|
|
|
IF(WITH_SNDFILE)
|
|
|
|
LINK_DIRECTORIES(${SNDFILE_LIBPATH})
|
|
|
|
ENDIF(WITH_SNDFILE)
|
2009-08-09 10:55:25 +00:00
|
|
|
IF(WITH_FFTW3)
|
|
|
|
LINK_DIRECTORIES(${FFTW3_LIBPATH})
|
2009-08-17 18:07:40 +00:00
|
|
|
ENDIF(WITH_FFTW3)
|
Merge of the COLLADA GSoC branch into trunk.
COLLADA code is disabled by default (it has dependencies requiring manual install).
SCons and CMake builds are supported on Windows and Linux, no Mac building yet. More on building COLLADA code: http://wiki.blender.org/index.php/User:Kazanbas/Building_Collada_Branch.
The detailed command log of the merge (can be useful for educational purposes):
branch=https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-chingachgook
# collada code
svn copy $branch/source/blender/collada source/blender/collada
# operator
svn merge -c 20401,20955,21077,24077,24079 $branch/source/blender/windowmanager/intern/wm_operators.c source/blender/windowmanager/intern/wm_operators.c
# menu
svn merge -c 24079 $branch/release/scripts/ui/space_info.py release/scripts/ui/space_info.py
# scons
svn merge -c 20398 $branch/source/blender/SConscript source/blender/SConscript
svn merge -c 20398,20691,20955,22726 $branch/tools/btools.py tools/btools.py
svn merge -c 20691,20955,22726 $branch/tools/Blender.py tools/Blender.py
svn merge -c 20398,20692,20955 $branch/config/linux2-config.py config/linux2-config.py
svn merge -c 22726 $branch/config/win64-vc-config.py config/win64-vc-config.py
svn merge -c 22726 $branch/config/win32-vc-config.py config/win32-vc-config.py
svn merge -c 24077 $branch/source/blender/windowmanager/SConscript source/blender/windowmanager/SConscript
# cmake
svn merge -c 23319,23905,24077,24158 $branch/CMakeLists.txt CMakeLists.txt
svn merge -c 23319 $branch/source/blender/CMakeLists.txt source/blender/CMakeLists.txt
svn merge -c 23319 $branch/source/creator/CMakeLists.txt source/creator/CMakeLists.txt
svn merge -c 23319 $branch/CMake/macros.cmake CMake/macros.cmake
svn merge -c 24077 $branch/source/blender/windowmanager/CMakeLists.txt source/blender/windowmanager/CMakeLists.txt
2009-10-30 15:35:50 +00:00
|
|
|
IF(WITH_OPENCOLLADA)
|
|
|
|
LINK_DIRECTORIES(${OPENCOLLADA_LIBPATH})
|
|
|
|
LINK_DIRECTORIES(${PCRE_LIBPATH})
|
|
|
|
LINK_DIRECTORIES(${EXPAT_LIBPATH})
|
|
|
|
ENDIF(WITH_OPENCOLLADA)
|
2006-11-17 02:27:12 +00:00
|
|
|
|
|
|
|
IF(WIN32)
|
|
|
|
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDMACRO(SETUP_LIBDIRS)
|
|
|
|
|
|
|
|
MACRO(SETUP_LIBLINKS
|
|
|
|
target)
|
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
|
2009-06-08 20:08:19 +00:00
|
|
|
|
2009-10-01 11:21:40 +00:00
|
|
|
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
|
2009-06-08 20:08:19 +00:00
|
|
|
|
|
|
|
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
|
2009-10-01 11:21:40 +00:00
|
|
|
IF(WITH_PYTHON)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LINKFLAGS})
|
|
|
|
|
|
|
|
IF(WIN32)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
|
|
|
|
ELSE(WIN32)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF(WITH_PYTHON)
|
2009-08-17 18:07:40 +00:00
|
|
|
|
2009-10-01 11:21:40 +00:00
|
|
|
TARGET_LINK_LIBRARIES(${target} ${OPENGL_glu_LIBRARY} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB})
|
2009-08-15 13:30:28 +00:00
|
|
|
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
|
2009-04-15 13:11:08 +00:00
|
|
|
|
2006-11-17 02:27:12 +00:00
|
|
|
IF(WITH_INTERNATIONAL)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
|
2009-10-02 03:09:17 +00:00
|
|
|
|
|
|
|
IF(WIN32)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
|
|
|
|
ENDIF(WIN32)
|
2006-11-17 02:27:12 +00:00
|
|
|
ENDIF(WITH_INTERNATIONAL)
|
2009-10-02 03:09:17 +00:00
|
|
|
|
2006-11-17 02:27:12 +00:00
|
|
|
IF(WITH_OPENAL)
|
2009-08-15 13:30:28 +00:00
|
|
|
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
|
2006-11-17 02:27:12 +00:00
|
|
|
ENDIF(WITH_OPENAL)
|
2009-08-17 18:07:40 +00:00
|
|
|
IF(WITH_FFTW3)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${FFTW3_LIB})
|
|
|
|
ENDIF(WITH_FFTW3)
|
2009-08-16 14:53:11 +00:00
|
|
|
IF(WITH_JACK)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
|
|
|
|
ENDIF(WITH_JACK)
|
2009-08-21 19:39:28 +00:00
|
|
|
IF(WITH_SNDFILE)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${SNDFILE_LIB})
|
|
|
|
ENDIF(WITH_SNDFILE)
|
2009-08-15 17:46:45 +00:00
|
|
|
IF(WITH_SDL)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
|
|
|
|
ENDIF(WITH_SDL)
|
2006-11-17 11:35:25 +00:00
|
|
|
IF(WITH_QUICKTIME)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
|
|
|
|
ENDIF(WITH_QUICKTIME)
|
2006-11-17 02:27:12 +00:00
|
|
|
IF(WITH_OPENEXR)
|
2010-01-17 19:19:15 +00:00
|
|
|
IF(WIN32)
|
|
|
|
FOREACH(loop_var ${OPENEXR_LIB})
|
|
|
|
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
|
|
|
|
ENDFOREACH(loop_var)
|
2010-01-17 22:12:00 +00:00
|
|
|
ELSE(WIN32)
|
2010-01-17 19:19:15 +00:00
|
|
|
TARGET_LINK_LIBRARIES(${target} ${OPENEXR_LIB})
|
|
|
|
ENDIF(WIN32)
|
2006-11-17 02:27:12 +00:00
|
|
|
ENDIF(WITH_OPENEXR)
|
|
|
|
IF(WITH_FFMPEG)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${FFMPEG_LIB})
|
|
|
|
ENDIF(WITH_FFMPEG)
|
Merge of the COLLADA GSoC branch into trunk.
COLLADA code is disabled by default (it has dependencies requiring manual install).
SCons and CMake builds are supported on Windows and Linux, no Mac building yet. More on building COLLADA code: http://wiki.blender.org/index.php/User:Kazanbas/Building_Collada_Branch.
The detailed command log of the merge (can be useful for educational purposes):
branch=https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-chingachgook
# collada code
svn copy $branch/source/blender/collada source/blender/collada
# operator
svn merge -c 20401,20955,21077,24077,24079 $branch/source/blender/windowmanager/intern/wm_operators.c source/blender/windowmanager/intern/wm_operators.c
# menu
svn merge -c 24079 $branch/release/scripts/ui/space_info.py release/scripts/ui/space_info.py
# scons
svn merge -c 20398 $branch/source/blender/SConscript source/blender/SConscript
svn merge -c 20398,20691,20955,22726 $branch/tools/btools.py tools/btools.py
svn merge -c 20691,20955,22726 $branch/tools/Blender.py tools/Blender.py
svn merge -c 20398,20692,20955 $branch/config/linux2-config.py config/linux2-config.py
svn merge -c 22726 $branch/config/win64-vc-config.py config/win64-vc-config.py
svn merge -c 22726 $branch/config/win32-vc-config.py config/win32-vc-config.py
svn merge -c 24077 $branch/source/blender/windowmanager/SConscript source/blender/windowmanager/SConscript
# cmake
svn merge -c 23319,23905,24077,24158 $branch/CMakeLists.txt CMakeLists.txt
svn merge -c 23319 $branch/source/blender/CMakeLists.txt source/blender/CMakeLists.txt
svn merge -c 23319 $branch/source/creator/CMakeLists.txt source/creator/CMakeLists.txt
svn merge -c 23319 $branch/CMake/macros.cmake CMake/macros.cmake
svn merge -c 24077 $branch/source/blender/windowmanager/CMakeLists.txt source/blender/windowmanager/CMakeLists.txt
2009-10-30 15:35:50 +00:00
|
|
|
IF(WITH_OPENCOLLADA)
|
2010-01-17 19:19:15 +00:00
|
|
|
IF(WIN32)
|
|
|
|
FOREACH(loop_var ${OPENCOLLADA_LIB})
|
|
|
|
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
|
|
|
|
ENDFOREACH(loop_var)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} debug ${PCRE_LIB}_d)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} optimized ${PCRE_LIB})
|
|
|
|
IF(EXPAT_LIB)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} debug ${EXPAT_LIB}_d)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} optimized ${EXPAT_LIB})
|
|
|
|
ENDIF(EXPAT_LIB)
|
|
|
|
ELSE(WIN32)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${OPENCOLLADA_LIB})
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${PCRE_LIB})
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${EXPAT_LIB})
|
|
|
|
ENDIF(WIN32)
|
Merge of the COLLADA GSoC branch into trunk.
COLLADA code is disabled by default (it has dependencies requiring manual install).
SCons and CMake builds are supported on Windows and Linux, no Mac building yet. More on building COLLADA code: http://wiki.blender.org/index.php/User:Kazanbas/Building_Collada_Branch.
The detailed command log of the merge (can be useful for educational purposes):
branch=https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-chingachgook
# collada code
svn copy $branch/source/blender/collada source/blender/collada
# operator
svn merge -c 20401,20955,21077,24077,24079 $branch/source/blender/windowmanager/intern/wm_operators.c source/blender/windowmanager/intern/wm_operators.c
# menu
svn merge -c 24079 $branch/release/scripts/ui/space_info.py release/scripts/ui/space_info.py
# scons
svn merge -c 20398 $branch/source/blender/SConscript source/blender/SConscript
svn merge -c 20398,20691,20955,22726 $branch/tools/btools.py tools/btools.py
svn merge -c 20691,20955,22726 $branch/tools/Blender.py tools/Blender.py
svn merge -c 20398,20692,20955 $branch/config/linux2-config.py config/linux2-config.py
svn merge -c 22726 $branch/config/win64-vc-config.py config/win64-vc-config.py
svn merge -c 22726 $branch/config/win32-vc-config.py config/win32-vc-config.py
svn merge -c 24077 $branch/source/blender/windowmanager/SConscript source/blender/windowmanager/SConscript
# cmake
svn merge -c 23319,23905,24077,24158 $branch/CMakeLists.txt CMakeLists.txt
svn merge -c 23319 $branch/source/blender/CMakeLists.txt source/blender/CMakeLists.txt
svn merge -c 23319 $branch/source/creator/CMakeLists.txt source/creator/CMakeLists.txt
svn merge -c 23319 $branch/CMake/macros.cmake CMake/macros.cmake
svn merge -c 24077 $branch/source/blender/windowmanager/CMakeLists.txt source/blender/windowmanager/CMakeLists.txt
2009-10-30 15:35:50 +00:00
|
|
|
ENDIF(WITH_OPENCOLLADA)
|
2006-11-17 02:27:12 +00:00
|
|
|
IF(WIN32)
|
|
|
|
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDMACRO(SETUP_LIBLINKS)
|
2009-08-17 18:07:40 +00:00
|
|
|
|