merge with/from trunk at r35190
[blender.git] / source / blenderplayer / CMakeLists.txt
1 # -*- mode: cmake; indent-tabs-mode: t; -*-
2 # $Id$
3 # ***** BEGIN GPL LICENSE BLOCK *****
4 #
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.
9 #
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.
14 #
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.
18 #
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
21 #
22 # The Original Code is: all of this file.
23 #
24 # Contributor(s): Jacques Beaurain.
25 #
26 # ***** END GPL LICENSE BLOCK *****
27
28 # message(STATUS "Configuring blenderplayer")
29
30 setup_libdirs()
31
32 if(WITH_CODEC_QUICKTIME)
33         add_definitions(-DWITH_QUICKTIME)
34 endif()
35
36 add_custom_command(
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
40 )
41
42 if(WIN32 AND NOT UNIX)
43         add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
44 else()
45         add_executable(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
46 endif()
47
48 add_dependencies(blenderplayer makesdna)
49
50 get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
51
52 list(APPEND BLENDER_LINK_LIBS
53         ge_player_common
54         ge_player_ghost
55         blenkernel_blc
56 )
57
58 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
59         list(APPEND BLENDER_LINK_LIBS extern_binreloc)
60 endif()
61
62 if(UNIX)
63         # Sort libraries
64 <<<<<<< .working
65         SET(BLENDER_SORTED_LIBS
66                 gp_ghost 
67                 gp_common 
68                 bf_intern_string 
69                 bf_intern_ghost 
70 =======
71         set(BLENDER_SORTED_LIBS
72                 ge_player_ghost 
73                 ge_player_common 
74                 bf_intern_string 
75                 bf_intern_ghost
76 >>>>>>> .merge-right.r35190
77                 bf_rna
78                 bf_blenkernel
79                 bf_blenloader 
80                 bf_blenpluginapi 
81 <<<<<<< .working
82                 bf_blroutines 
83                 bf_converter 
84                 bf_ketsji 
85                 bf_bullet 
86                 bf_common 
87                 bf_dummy 
88                 bf_logic 
89                 bf_rasterizer 
90                 bf_oglrasterizer 
91                 bf_expressions 
92                 bf_scenegraph
93                 bf_ikplugin
94                 bf_intern_itasc
95                 bf_intern_ik
96                 bf_intern_smoke
97 =======
98                 ge_blen_routines
99                 bf_editor_datafiles
100                 ge_converter 
101                 ge_logic_ketsji 
102                 ge_phys_bullet 
103                 ge_phys_dummy
104                 ge_phys_common 
105                 ge_logic 
106                 ge_rasterizer 
107                 ge_oglrasterizer 
108                 ge_logic_expressions 
109                 ge_scenegraph
110                 bf_ikplugin
111                 bf_intern_itasc
112                 bf_intern_ik
113                 bf_intern_smoke
114 >>>>>>> .merge-right.r35190
115                 bf_modifiers
116 <<<<<<< .working
117                 bf_intern_moto 
118                 bf_kernel 
119 =======
120                 bf_intern_moto 
121                 bf_gen_system 
122 >>>>>>> .merge-right.r35190
123                 bf_nodes
124                 bf_gpu
125                 bf_imbuf
126                 bf_avi 
127                 ge_logic_network 
128                 ge_logic_ngnetwork 
129                 ge_logic_loopbacknetwork 
130                 extern_bullet 
131                 bf_intern_guardedalloc 
132                 bf_intern_memutil 
133                 bf_python
134                 bf_python_ext
135                 bf_blenlib 
136 <<<<<<< .working
137                 bf_cineon
138                 bf_openexr 
139                 extern_openjpeg 
140                 bf_dds
141 =======
142                 bf_imbuf_cineon
143                 bf_imbuf_openexr 
144                 extern_openjpeg 
145                 bf_imbuf_dds
146 >>>>>>> .merge-right.r35190
147                 bf_readblenfile 
148                 bf_dna
149                 ge_videotex
150                 bf_blenfont
151                 bf_intern_audaspace
152                 blenkernel_blc
153                 extern_binreloc
154                 extern_glew
155                 extern_minilzo
156                 bf_intern_ghost # duplicate for linking
157                 bf_blenkernel # duplicate for linking
158                 bf_intern_mikktspace
159         )
160
161 <<<<<<< .working
162         IF(WITH_CXX_GUARDEDALLOC)
163                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_intern_guardedalloc_cpp)
164         ENDIF(WITH_CXX_GUARDEDALLOC)
165 =======
166         if(WITH_CODEC_QUICKTIME)
167                 list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
168         endif()
169 >>>>>>> .merge-right.r35190
170
171         if(WITH_CXX_GUARDEDALLOC)
172                 list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
173         endif()
174
175         foreach(SORTLIB ${BLENDER_SORTED_LIBS})
176                 set(REMLIB ${SORTLIB})
177                 foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
178                         if(${SEARCHLIB} STREQUAL ${SORTLIB})
179                                 set(REMLIB "")
180                         endif()
181                 endforeach()
182                 if(REMLIB)
183                         # message(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured")
184                         list(APPEND REM_MSG ${REMLIB})
185                         list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
186                 endif()
187         endforeach()
188         if(REM_MSG)
189                 list(SORT REM_MSG)
190                 message(STATUS "Player Skipping: (${REM_MSG})")
191         endif()
192         target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS})
193 else()
194         target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS})
195 endif()
196
197 if(WITH_PLAYER)
198         add_subdirectory(bad_level_call_stubs)
199 endif()
200
201 setup_liblinks(blenderplayer)