Cleanup: remove accidentally committed debug code.
[blender.git] / source / blenderplayer / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # The Original Code is Copyright (C) 2006, Blender Foundation
18 # All rights reserved.
19 #
20 # The Original Code is: all of this file.
21 #
22 # Contributor(s): Jacques Beaurain.
23 #
24 # ***** END GPL LICENSE BLOCK *****
25
26 # message(STATUS "Configuring blenderplayer")
27
28 setup_libdirs()
29
30 if(WIN32 AND NOT UNIX)
31         string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
32         string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
33         string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
34         add_definitions(
35                 -DBLEN_VER_RC_STR=${BLENDER_VERSION}
36                 -DBLEN_VER_RC_1=${bver1}
37                 -DBLEN_VER_RC_2=${bver2}
38                 -DBLEN_VER_RC_3=${bver3}
39                 -DBLEN_VER_RC_4=0
40         )
41
42         add_executable(
43                         blenderplayer ${EXETYPE}
44                         bad_level_call_stubs/stubs.c
45                         ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.rc)
46         WINDOWS_SIGN_TARGET(blenderplayer)
47         install(TARGETS blenderplayer
48                         COMPONENT Blenderplayer
49                         DESTINATION ".")
50
51 add_cc_flags_custom_test(blenderplayer)
52
53 elseif(APPLE)
54         add_executable(blenderplayer ${EXETYPE} bad_level_call_stubs/stubs.c)
55         # setup Info.plist
56         execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
57         set(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/blenderplayer.app)
58         set(PLAYER_SOURCEINFO ${PLAYER_SOURCEDIR}/Contents/Info.plist)
59         set_target_properties(blenderplayer PROPERTIES
60                 MACOSX_BUNDLE_INFO_PLIST ${PLAYER_SOURCEINFO}
61                 MACOSX_BUNDLE_SHORT_VERSION_STRING "${BLENDER_VERSION}${BLENDER_VERSION_CHAR}"
62                 MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION}${BLENDER_VERSION_CHAR} ${BLENDER_DATE}")
63
64 else()
65         add_executable(blenderplayer bad_level_call_stubs/stubs.c)
66
67         if(NOT WITH_INSTALL_PORTABLE)
68                 install(
69                         TARGETS blenderplayer
70                         DESTINATION bin
71                 )
72         else()
73                 install(
74                         TARGETS blenderplayer
75                         DESTINATION "."
76                 )
77         endif()
78 endif()
79
80 add_dependencies(blenderplayer makesdna)
81
82 get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
83
84 list(APPEND BLENDER_LINK_LIBS
85         ge_player_common
86         ge_player_ghost
87         blenkernel_blc
88 )
89
90 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
91         list(APPEND BLENDER_LINK_LIBS extern_binreloc)
92 endif()
93
94 # if(UNIX)
95         # Sort libraries
96         set(BLENDER_SORTED_LIBS
97                 ge_player_ghost
98                 ge_player_common
99                 bf_intern_string
100                 bf_intern_ghost
101                 bf_rna
102                 bf_blenkernel
103                 bf_depsgraph
104                 bf_physics
105                 bf_intern_rigidbody
106                 bf_blenloader
107                 ge_blen_routines
108                 bf_editor_datafiles
109                 ge_converter
110                 ge_logic_ketsji
111                 ge_phys_bullet
112                 ge_phys_dummy
113                 ge_logic
114                 ge_rasterizer
115                 ge_oglrasterizer
116                 ge_logic_expressions
117                 ge_scenegraph
118                 bf_ikplugin
119                 bf_intern_itasc
120                 bf_intern_iksolver
121                 bf_intern_smoke
122                 bf_modifiers
123                 bf_intern_moto
124                 bf_nodes
125                 bf_gpu
126                 bf_imbuf
127                 bf_avi
128                 ge_logic_network
129                 ge_logic_ngnetwork
130                 ge_logic_loopbacknetwork
131                 extern_bullet
132                 bf_intern_guardedalloc
133                 bf_intern_memutil
134                 bf_python_ext
135                 bf_python_mathutils
136                 bf_python_bmesh
137                 bf_intern_utfconv
138                 bf_imbuf_cineon
139                 bf_imbuf_openexr
140                 bf_imbuf_openimageio
141                 extern_openjpeg
142                 bf_imbuf_dds
143                 bf_dna
144                 ge_videotex
145                 bf_blenfont
146                 bf_blentranslation
147                 bf_intern_audaspace
148                 blenkernel_blc
149                 bf_bmesh
150                 bf_blenlib
151                 bf_intern_utfconv
152                 extern_binreloc
153                 extern_minilzo
154                 bf_intern_ghost # duplicate for linking
155                 bf_blenkernel # duplicate for linking
156                 bf_intern_mikktspace
157                 extern_recastnavigation
158                 bf_intern_opencolorio
159                 bf_intern_glew_mx
160                 bf_intern_eigen
161                 extern_rangetree
162                 extern_wcwidth
163                 bf_intern_libmv
164                 extern_sdlew
165                 bf_intern_numaapi
166         )
167
168         if(NOT WITH_SYSTEM_GLOG)
169                 list(APPEND BLENDER_SORTED_LIBS extern_glog)
170         endif()
171
172         if(NOT WITH_SYSTEM_GFLAGS)
173                 list(APPEND BLENDER_SORTED_LIBS extern_gflags)
174         endif()
175
176         if(WITH_MOD_CLOTH_ELTOPO)
177                 list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
178         endif()
179
180         if(NOT WITH_SYSTEM_GLEW)
181                 list(APPEND BLENDER_SORTED_LIBS ${BLENDER_GLEW_LIBRARIES})
182         endif()
183
184         if(WITH_LZMA)
185                 list(APPEND BLENDER_SORTED_LIBS extern_lzma)
186         endif()
187
188         if(WITH_LIBMV)
189                 list(APPEND BLENDER_SORTED_LIBS extern_ceres)
190         endif()
191
192         if(WITH_GHOST_XDND)
193                 list(APPEND BLENDER_SORTED_LIBS extern_xdnd)
194         endif()
195
196         if(WITH_CXX_GUARDEDALLOC)
197                 list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
198         endif()
199
200         if(WITH_INTERNATIONAL)
201                 list(APPEND BLENDER_SORTED_LIBS bf_intern_locale)
202         endif()
203
204         if(WITH_GAMEENGINE_DECKLINK)
205                 list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
206         endif()
207
208         if(WIN32)
209                 list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
210         endif()
211
212         if(WITH_OPENSUBDIV)
213                 list(APPEND BLENDER_SORTED_LIBS bf_intern_opensubdiv)
214         endif()
215
216         if(WITH_OPENVDB)
217                 list(APPEND BLENDER_SORTED_LIBS bf_intern_openvdb)
218         endif()
219
220         if(WITH_ALEMBIC)
221                 list(APPEND BLENDER_SORTED_LIBS bf_alembic)
222         endif()
223
224         foreach(SORTLIB ${BLENDER_SORTED_LIBS})
225                 set(REMLIB ${SORTLIB})
226                 foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
227                         if(${SEARCHLIB} STREQUAL ${SORTLIB})
228                                 set(REMLIB "")
229                         endif()
230                 endforeach()
231                 if(REMLIB)
232                         # message(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured")
233                         list(APPEND REM_MSG ${REMLIB})
234                         list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
235                 endif()
236         endforeach()
237         if(REM_MSG)
238                 list(SORT REM_MSG)
239                 message(STATUS "Player Skipping: (${REM_MSG})")
240         endif()
241         target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS})
242
243         unset(SEARCHLIB)
244         unset(SORTLIB)
245         unset(REMLIB)
246         unset(REM_MSG)
247
248 # else()
249 #       target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS})
250 # endif()
251
252 if(WITH_PLAYER)
253         add_subdirectory(bad_level_call_stubs)
254 endif()
255
256 setup_liblinks(blenderplayer)
257
258 # We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES dpeends on them..
259 if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
260         target_link_libraries(blenderplayer "extern_clew")
261         if(WITH_CUDA_DYNLOAD)
262                 target_link_libraries(blenderplayer "extern_cuew")
263         else()
264                 target_link_libraries(${target} ${CUDA_CUDA_LIBRARY})
265         endif()
266 endif()