copy of docs from 2.4x for python modules that have been kept
[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_ikplugin
85         bf_ITASC
86         bf_IK
87         bf_smoke
88                 bf_moto 
89                 bf_kernel 
90                 bf_nodes
91                 bf_gpu
92                 bf_imbuf
93                 bf_avi 
94                 kx_network 
95                 bf_ngnetwork 
96                 bf_loopbacknetwork 
97                 extern_bullet 
98                 bf_guardedalloc 
99                 bf_memutil 
100                 bf_python
101                 bf_gen_python
102                 bf_blenlib 
103                 bf_cineon 
104                 bf_openexr 
105                 extern_libopenjpeg 
106                 bf_dds
107                 bf_readblenfile 
108                 bf_dna
109                 bf_videotex
110                 bf_blenfont
111                 bf_audaspace
112                 blenkernel_blc
113                 extern_binreloc
114                 extern_glew
115         )
116   
117         IF(WITH_QUICKTIME)
118                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} quicktime)
119         ENDIF(WITH_QUICKTIME)
120
121         IF(WITH_CXX_GUARDEDALLOC)
122                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp)
123         ENDIF(WITH_CXX_GUARDEDALLOC)
124
125         FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
126                 SET(REMLIB ${SORTLIB})
127                 FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS})
128                         IF(${SEARCHLIB} STREQUAL ${SORTLIB})
129                                 SET(REMLIB "")
130                         ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB})
131                 ENDFOREACH(SEARCHLIB)
132                 IF(REMLIB)
133                         MESSAGE(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured")
134                         LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
135                 ENDIF(REMLIB)
136         ENDFOREACH(SORTLIB)
137
138         TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_SORTED_LIBS})
139 ELSE(UNIX)
140         TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_LINK_LIBS})
141 ENDIF(UNIX)
142
143 IF(WITH_PLAYER)
144         ADD_SUBDIRECTORY(bad_level_call_stubs)
145 ENDIF(WITH_PLAYER)
146
147 SETUP_LIBLINKS(blenderplayer)