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)
47 -DBLEN_VER_RC_STR=${BLENDER_VERSION}
48 -DBLEN_VER_RC_1=${bver1}
49 -DBLEN_VER_RC_2=${bver2}
50 -DBLEN_VER_RC_3=${bver3}
53 add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
55 add_executable(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
58 add_dependencies(blenderplayer makesdna)
60 get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
62 list(APPEND BLENDER_LINK_LIBS
68 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
69 list(APPEND BLENDER_LINK_LIBS extern_binreloc)
74 set(BLENDER_SORTED_LIBS
108 ge_logic_loopbacknetwork
110 bf_intern_guardedalloc
127 bf_intern_ghost # duplicate for linking
128 bf_blenkernel # duplicate for linking
132 if(WITH_BUILTIN_GLEW)
133 list(APPEND BLENDER_SORTED_LIBS extern_glew)
137 list(APPEND BLENDER_SORTED_LIBS extern_lzma)
140 if(WITH_MOD_DECIMATE)
141 list(APPEND BLENDER_SORTED_LIBS bf_intern_decimate)
145 list(APPEND BLENDER_SORTED_LIBS bf_intern_bsp)
146 list(APPEND BLENDER_SORTED_LIBS bf_intern_bop)
147 list(APPEND BLENDER_SORTED_LIBS bf_intern_moto)
150 if(WITH_CODEC_QUICKTIME)
151 list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
154 if(WITH_CXX_GUARDEDALLOC)
155 list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
158 foreach(SORTLIB ${BLENDER_SORTED_LIBS})
159 set(REMLIB ${SORTLIB})
160 foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
161 if(${SEARCHLIB} STREQUAL ${SORTLIB})
166 # message(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured")
167 list(APPEND REM_MSG ${REMLIB})
168 list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
173 message(STATUS "Player Skipping: (${REM_MSG})")
175 target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS})
177 # target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS})
181 add_subdirectory(bad_level_call_stubs)
184 setup_liblinks(blenderplayer)