svn merge -r37030:37035 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / makesrna / intern / CMakeLists.txt
1 # -*- mode: cmake; indent-tabs-mode: t; -*-
2 # $Id: CMakeLists.txt 17433 2008-11-12 21:16:53Z blendix $
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 # Generated code has some unused vars we can ignore.
29 remove_strict_flags()
30
31 # message(STATUS "Configuring makesrna")
32
33 # files rna_access.c rna_define.c makesrna.c intentionally excluded.
34 set(DEFSRC
35         rna_ID.c
36         rna_action.c
37         rna_actuator.c
38         rna_animation.c
39         rna_animviz.c
40         rna_armature.c
41         rna_boid.c
42         rna_brush.c
43         rna_camera.c
44         rna_cloth.c
45         rna_color.c
46         rna_constraint.c
47         rna_context.c
48         rna_controller.c
49         rna_curve.c
50         rna_fcurve.c
51         rna_fluidsim.c
52         rna_gpencil.c
53         rna_group.c
54         rna_image.c
55         rna_key.c
56         rna_lamp.c
57         rna_lattice.c
58         rna_main.c
59         rna_material.c
60         rna_mesh.c
61         rna_meta.c
62         rna_modifier.c
63         rna_nla.c
64         rna_nodetree.c
65         rna_object.c
66         rna_object_force.c
67         rna_packedfile.c
68         rna_particle.c
69         rna_pose.c
70         rna_property.c
71         rna_render.c
72         rna_rna.c
73         rna_scene.c
74         rna_screen.c
75         rna_sculpt_paint.c
76         rna_sensor.c
77         rna_sequencer.c
78         rna_smoke.c
79         rna_sound.c
80         rna_space.c
81         rna_test.c
82         rna_text.c
83         rna_texture.c
84         rna_timeline.c
85         rna_ui.c
86         rna_userdef.c
87         rna_vfont.c
88         rna_wm.c
89         rna_world.c
90 )
91
92 set(APISRC
93         rna_action_api.c
94         rna_actuator_api.c
95         rna_animation_api.c
96         rna_armature_api.c
97         rna_controller_api.c
98         rna_fcurve_api.c
99         rna_image_api.c
100         rna_main_api.c
101         rna_material_api.c
102         rna_mesh_api.c
103         rna_object_api.c
104         rna_pose_api.c
105         rna_scene_api.c
106         rna_sensor_api.c
107         rna_sequencer_api.c
108         rna_text_api.c
109         rna_ui_api.c
110         rna_wm_api.c
111 )
112
113 string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
114 set_source_files_properties(GENSRC PROPERTIES GENERATED true)
115
116 set(SRC_RNA_INC
117         ../RNA_access.h
118         ../RNA_define.h
119         ../RNA_documentation.h
120         ../RNA_enum_types.h
121         ../RNA_types.h
122 )
123
124 set(SRC
125         makesrna.c
126         rna_define.c
127         ${DEFSRC}
128         ${APISRC}
129         ../../../../intern/guardedalloc/intern/mallocn.c
130         ../../../../intern/guardedalloc/intern/mmap_win.c
131 )
132
133 set(INC
134
135 )
136
137 set(INC_SYS
138
139 )
140
141
142 if(WITH_PYTHON)
143         add_definitions(-DWITH_PYTHON)
144 endif()
145
146 if(WITH_GAMEENGINE)
147         add_definitions(-DWITH_GAMEENGINE)
148 endif()
149
150 if(WITH_IMAGE_OPENEXR)
151         add_definitions(-DWITH_OPENEXR)
152 endif()
153
154 if(WITH_IMAGE_TIFF)
155         add_definitions(-DWITH_TIFF)
156 endif()
157
158 if(WITH_IMAGE_OPENJPEG)
159         add_definitions(-DWITH_OPENJPEG)
160 endif()
161
162 if(WITH_IMAGE_DDS)
163         add_definitions(-DWITH_DDS)
164 endif()
165
166 if(WITH_IMAGE_CINEON)
167         add_definitions(-DWITH_CINEON)
168 endif()
169
170 if(WITH_IMAGE_HDR)
171         add_definitions(-DWITH_HDR)
172 endif()
173
174 if(WITH_CODEC_QUICKTIME)
175         list(APPEND INC ../../quicktime)
176         add_definitions(-DWITH_QUICKTIME)
177 endif()
178
179 if(WITH_CODEC_FFMPEG)
180         list(APPEND INC_SYS ${FFMPEG_INC})
181         add_definitions(-DWITH_FFMPEG)
182 endif()
183
184 if(NOT WITH_MOD_FLUID)
185         add_definitions(-DDISABLE_ELBEEM)
186 endif()
187
188 if(WITH_FFTW3)
189         add_definitions(-DFFTW3=1)
190 endif()
191
192 if(WITH_SDL)
193         add_definitions(-DWITH_SDL)
194 endif()
195
196 if(WITH_OPENAL)
197         add_definitions(-DWITH_OPENAL)
198 endif()
199
200 if(WITH_JACK)
201         add_definitions(-DWITH_JACK)
202 endif()
203
204 if(WITH_OPENCOLLADA)
205         add_definitions(-DWITH_COLLADA)
206 endif()
207
208 # Build makesrna executable
209 blender_include_dirs(
210         .
211         ..
212         ../../blenkernel
213         ../../blenloader
214         ../../blenlib
215         ../../bmesh
216         ../../blenfont
217         ../../gpu
218         ../../imbuf
219         ../../ikplugin
220         ../../makesdna
221         ../../windowmanager
222         ../../editors/include
223         ../../render/extern/include
224         ../../../../intern/audaspace/intern
225         ../../../../intern/guardedalloc
226         ../../../../intern/memutil
227 )
228
229 blender_include_dirs_sys(
230         ${GLEW_INCLUDE_PATH}
231 )
232
233 add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
234 target_link_libraries(makesrna bf_dna)
235
236 # Output rna_*_gen.c
237 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
238 add_custom_command(
239         OUTPUT ${GENSRC}
240         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
241         DEPENDS makesrna
242 )
243
244 # Build bf_rna
245 set(SRC
246         rna_access.c
247         ${GENSRC}
248
249         ${SRC_RNA_INC}
250         rna_internal.h
251         rna_internal_types.h
252         rna_nodetree_types.h
253 )
254
255 blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}")