1 # -*- mode: cmake; indent-tabs-mode: t; -*-
2 # ***** BEGIN GPL LICENSE BLOCK *****
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 # The Original Code is Copyright (C) 2006, Blender Foundation
19 # All rights reserved.
21 # The Original Code is: all of this file.
23 # Contributor(s): Jacques Beaurain.
25 # ***** END GPL LICENSE BLOCK *****
27 # message(STATUS "Configuring blenderplayer")
31 if(WITH_CODEC_QUICKTIME)
32 add_definitions(-DWITH_QUICKTIME)
36 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c
37 COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
38 DEPENDS ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna
41 if(WIN32 AND NOT UNIX)
42 string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
43 string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
44 string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
48 -DBLEN_VER_RC_STR_M=${BLENDER_VERSION}
49 -DBLEN_VER_RC_1=${bver1}
50 -DBLEN_VER_RC_2=${bver2}
51 -DBLEN_VER_RC_3=${bver3}
56 -DBLEN_VER_RC_STR=${BLENDER_VERSION}
57 -DBLEN_VER_RC_1=${bver1}
58 -DBLEN_VER_RC_2=${bver2}
59 -DBLEN_VER_RC_3=${bver3}
64 add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
67 add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
69 execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
70 set(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
71 set(PLAYER_SOURCEINFO ${PLAYER_SOURCEDIR}/Contents/Info.plist)
72 set_target_properties(blenderplayer PROPERTIES
73 MACOSX_BUNDLE_INFO_PLIST ${PLAYER_SOURCEINFO}
74 MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
75 MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
78 add_executable(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
81 add_dependencies(blenderplayer makesdna)
83 get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
85 list(APPEND BLENDER_LINK_LIBS
91 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
92 list(APPEND BLENDER_LINK_LIBS extern_binreloc)
97 set(BLENDER_SORTED_LIBS
130 ge_logic_loopbacknetwork
132 bf_intern_guardedalloc
149 bf_intern_ghost # duplicate for linking
150 bf_blenkernel # duplicate for linking
152 extern_recastnavigation
155 if(WITH_MOD_CLOTH_ELTOPO)
156 list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
159 if(WITH_BUILTIN_GLEW)
160 list(APPEND BLENDER_SORTED_LIBS extern_glew)
164 list(APPEND BLENDER_SORTED_LIBS extern_lzma)
168 list(APPEND BLENDER_SORTED_LIBS extern_libmv)
171 list(APPEND BLENDER_SORTED_LIBS extern_colamd)
173 if(WITH_MOD_DECIMATE)
174 list(APPEND BLENDER_SORTED_LIBS bf_intern_decimate)
178 list(APPEND BLENDER_SORTED_LIBS bf_intern_bsp)
179 list(APPEND BLENDER_SORTED_LIBS bf_intern_bop)
180 list(APPEND BLENDER_SORTED_LIBS bf_intern_moto)
183 if(WITH_CODEC_QUICKTIME)
184 list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
187 if(WITH_CXX_GUARDEDALLOC)
188 list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
191 foreach(SORTLIB ${BLENDER_SORTED_LIBS})
192 set(REMLIB ${SORTLIB})
193 foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
194 if(${SEARCHLIB} STREQUAL ${SORTLIB})
199 # message(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured")
200 list(APPEND REM_MSG ${REMLIB})
201 list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
206 message(STATUS "Player Skipping: (${REM_MSG})")
208 target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS})
216 # target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS})
220 add_subdirectory(bad_level_call_stubs)
223 setup_liblinks(blenderplayer)