UI
[blender.git] / source / blenderplayer / CMakeLists.txt
1 # $Id$
2 # ***** BEGIN GPL LICENSE BLOCK *****
3 #
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.
8 #
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.
13 #
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17 #
18 # The Original Code is Copyright (C) 2006, Blender Foundation
19 # All rights reserved.
20 #
21 # The Original Code is: all of this file.
22 #
23 # Contributor(s): Jacques Beaurain.
24 #
25 # ***** END GPL LICENSE BLOCK *****
26
27 MESSAGE(STATUS "Configuring blenderplayer")
28
29 SETUP_LIBDIRS()
30
31 IF(WITH_QUICKTIME)
32         ADD_DEFINITIONS(-DWITH_QUICKTIME)
33 ENDIF(WITH_QUICKTIME)
34
35 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
36         ADD_DEFINITIONS(-DWITH_BINRELOC)
37         INCLUDE_DIRECTORIES(${BINRELOC_INC})
38 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
39
40 ADD_CUSTOM_COMMAND(
41         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c
42         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
43         DEPENDS ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna
44 )
45
46 IF(WIN32)
47         ADD_EXECUTABLE(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
48 ELSE(WIN32)
49         ADD_EXECUTABLE(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
50 ENDIF(WIN32)
51
52 ADD_DEPENDENCIES(blenderplayer makesdna)
53
54 FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS)
55
56 SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} gp_common gp_ghost blenkernel_blc)
57
58 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
59         SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc)
60 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
61
62 IF(UNIX)
63         # Sort libraries
64         SET(BLENDER_SORTED_LIBS
65                 gp_ghost 
66                 gp_common 
67                 bf_string 
68                 bf_ghost 
69                 bf_rna
70                 bf_blenkernel
71                 bf_blenloader 
72                 bf_blenpluginapi 
73                 bf_blroutines 
74                 bf_converter 
75                 bf_ketsji 
76                 bf_bullet 
77                 bf_common 
78                 bf_dummy 
79                 bf_logic 
80                 bf_rasterizer 
81                 bf_oglrasterizer 
82                 bf_expressions 
83                 bf_scenegraph 
84                 bf_IK
85                 bf_moto 
86                 bf_kernel 
87                 bf_nodes
88                 bf_gpu
89                 bf_imbuf
90                 bf_avi 
91                 kx_network 
92                 bf_ngnetwork 
93                 bf_loopbacknetwork 
94                 extern_bullet 
95                 bf_guardedalloc 
96                 bf_memutil 
97                 bf_python
98                 bf_gen_python
99                 bf_blenlib 
100                 bf_cineon 
101                 bf_openexr 
102                 extern_libopenjpeg 
103                 bf_dds
104                 bf_readblenfile 
105                 bf_dna
106                 bf_videotex
107                 bf_blenfont
108                 bf_audaspace
109                 blenkernel_blc
110                 extern_binreloc
111                 extern_glew
112         )
113   
114         IF(WITH_QUICKTIME)
115                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} quicktime)
116         ENDIF(WITH_QUICKTIME)
117
118         IF(WITH_CXX_GUARDEDALLOC)
119                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp)
120         ENDIF(WITH_CXX_GUARDEDALLOC)
121
122         FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
123                 SET(REMLIB ${SORTLIB})
124                 FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS})
125                         IF(${SEARCHLIB} STREQUAL ${SORTLIB})
126                                 SET(REMLIB "")
127                         ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB})
128                 ENDFOREACH(SEARCHLIB)
129                 IF(REMLIB)
130                         MESSAGE(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured")
131                         LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
132                 ENDIF(REMLIB)
133         ENDFOREACH(SORTLIB)
134
135         TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_SORTED_LIBS})
136 ELSE(UNIX)
137         TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_LINK_LIBS})
138 ENDIF(UNIX)
139
140 IF(WITH_PLAYER)
141         ADD_SUBDIRECTORY(bad_level_call_stubs)
142 ENDIF(WITH_PLAYER)
143
144 SETUP_LIBLINKS(blenderplayer)