1 # -*- mode: cmake; indent-tabs-mode: t; -*-
3 # ***** BEGIN GPL LICENSE BLOCK *****
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
22 # The Original Code is: all of this file.
24 # Contributor(s): Jacques Beaurain.
26 # ***** END GPL LICENSE BLOCK *****
28 # message(STATUS "Configuring blenderplayer")
32 if(WITH_CODEC_QUICKTIME)
33 add_definitions(-DWITH_QUICKTIME)
37 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c
38 COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
39 DEPENDS ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna
42 if(WIN32 AND NOT UNIX)
43 string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
44 string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
45 string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
49 -DBLEN_VER_RC_STR_M=${BLENDER_VERSION}
50 -DBLEN_VER_RC_1=${bver1}
51 -DBLEN_VER_RC_2=${bver2}
52 -DBLEN_VER_RC_3=${bver3}
57 -DBLEN_VER_RC_STR=${BLENDER_VERSION}
58 -DBLEN_VER_RC_1=${bver1}
59 -DBLEN_VER_RC_2=${bver2}
60 -DBLEN_VER_RC_3=${bver3}
65 add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
67 add_executable(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
70 add_dependencies(blenderplayer makesdna)
72 get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
74 list(APPEND BLENDER_LINK_LIBS
80 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
81 list(APPEND BLENDER_LINK_LIBS extern_binreloc)
86 set(BLENDER_SORTED_LIBS
119 ge_logic_loopbacknetwork
121 bf_intern_guardedalloc
138 bf_intern_ghost # duplicate for linking
139 bf_blenkernel # duplicate for linking
141 extern_recastnavigation
144 if(WITH_MOD_CLOTH_ELTOPO)
145 list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
148 if(WITH_BUILTIN_GLEW)
149 list(APPEND BLENDER_SORTED_LIBS extern_glew)
153 list(APPEND BLENDER_SORTED_LIBS extern_lzma)
156 if(WITH_MOD_DECIMATE)
157 list(APPEND BLENDER_SORTED_LIBS bf_intern_decimate)
161 list(APPEND BLENDER_SORTED_LIBS bf_intern_bsp)
162 list(APPEND BLENDER_SORTED_LIBS bf_intern_bop)
163 list(APPEND BLENDER_SORTED_LIBS bf_intern_moto)
166 if(WITH_CODEC_QUICKTIME)
167 list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
170 if(WITH_CXX_GUARDEDALLOC)
171 list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
174 foreach(SORTLIB ${BLENDER_SORTED_LIBS})
175 set(REMLIB ${SORTLIB})
176 foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
177 if(${SEARCHLIB} STREQUAL ${SORTLIB})
182 # message(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured")
183 list(APPEND REM_MSG ${REMLIB})
184 list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
189 message(STATUS "Player Skipping: (${REM_MSG})")
191 target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS})
199 # target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS})
203 add_subdirectory(bad_level_call_stubs)
206 setup_liblinks(blenderplayer)