Merged changes in the trunk up to revision 54992.
[blender-staging.git] / source / blender / makesrna / intern / 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 # Generated code has some unused vars we can ignore.
27 remove_strict_flags()
28
29 # message(STATUS "Configuring makesrna")
30
31 # files rna_access.c rna_define.c makesrna.c intentionally excluded.
32 set(DEFSRC
33         rna_ID.c
34         rna_action.c
35         rna_actuator.c
36         rna_animation.c
37         rna_animviz.c
38         rna_armature.c
39         rna_boid.c
40         rna_brush.c
41         rna_camera.c
42         rna_cloth.c
43         rna_color.c
44         rna_constraint.c
45         rna_context.c
46         rna_controller.c
47         rna_curve.c
48         rna_dynamicpaint.c
49         rna_fcurve.c
50         rna_fluidsim.c
51         rna_gpencil.c
52         rna_group.c
53         rna_image.c
54         rna_key.c
55         rna_lamp.c
56         rna_lattice.c
57         rna_main.c
58         rna_mask.c
59         rna_material.c
60         rna_mesh.c
61         rna_meta.c
62         rna_modifier.c
63         rna_movieclip.c
64         rna_nla.c
65         rna_nodetree.c
66         rna_object.c
67         rna_object_force.c
68         rna_packedfile.c
69         rna_particle.c
70         rna_pose.c
71         rna_property.c
72         rna_render.c
73         rna_rigidbody.c
74         rna_rna.c
75         rna_scene.c
76         rna_screen.c
77         rna_sculpt_paint.c
78         rna_sensor.c
79         rna_sequencer.c
80         rna_smoke.c
81         rna_sound.c
82         rna_space.c
83         rna_speaker.c
84         rna_test.c
85         rna_text.c
86         rna_texture.c
87         rna_timeline.c
88         rna_tracking.c
89         rna_ui.c
90         rna_userdef.c
91         rna_vfont.c
92         rna_wm.c
93         rna_world.c
94 )
95
96 if(WITH_FREESTYLE)
97         list(APPEND DEFSRC
98                 rna_linestyle.c
99         )
100 endif()
101
102 set(APISRC
103         rna_action_api.c
104         rna_actuator_api.c
105         rna_animation_api.c
106         rna_armature_api.c
107         rna_camera_api.c
108         rna_controller_api.c
109         rna_fcurve_api.c
110         rna_image_api.c
111         rna_main_api.c
112         rna_material_api.c
113         rna_mesh_api.c
114         rna_meta_api.c
115         rna_texture_api.c
116         rna_object_api.c
117         rna_pose_api.c
118         rna_scene_api.c
119         rna_sensor_api.c
120         rna_sequencer_api.c
121         rna_text_api.c
122         rna_ui_api.c
123         rna_wm_api.c
124 )
125
126 string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
127 set_source_files_properties(GENSRC PROPERTIES GENERATED true)
128
129 set(SRC_RNA_INC
130         ../RNA_access.h
131         ../RNA_define.h
132         ../RNA_documentation.h
133         ../RNA_enum_types.h
134         ../RNA_types.h
135 )
136
137 set(SRC
138         makesrna.c
139         rna_define.c
140         ${DEFSRC}
141         ${APISRC}
142         ../../../../intern/guardedalloc/intern/mallocn.c
143         ../../../../intern/guardedalloc/intern/mmap_win.c
144 )
145
146 set(INC
147
148 )
149
150 set(INC_SYS
151
152 )
153
154 if(WITH_CYCLES)
155         add_definitions(-DWITH_CYCLES)
156 endif()
157
158 if(WITH_PYTHON)
159         add_definitions(-DWITH_PYTHON)
160 endif()
161
162 if(WITH_GAMEENGINE)
163         add_definitions(-DWITH_GAMEENGINE)
164 endif()
165
166 if(WITH_IMAGE_OPENEXR)
167         add_definitions(-DWITH_OPENEXR)
168 endif()
169
170 if(WITH_IMAGE_TIFF)
171         add_definitions(-DWITH_TIFF)
172 endif()
173
174 if(WITH_IMAGE_OPENJPEG)
175         add_definitions(-DWITH_OPENJPEG)
176 endif()
177
178 if(WITH_IMAGE_DDS)
179         add_definitions(-DWITH_DDS)
180 endif()
181
182 if(WITH_IMAGE_CINEON)
183         add_definitions(-DWITH_CINEON)
184 endif()
185
186 if(WITH_IMAGE_HDR)
187         add_definitions(-DWITH_HDR)
188 endif()
189
190 if(WITH_IMAGE_FRAMESERVER)
191         add_definitions(-DWITH_FRAMESERVER)
192 endif()
193
194 if(WITH_AUDASPACE)
195         add_definitions(-DWITH_AUDASPACE)
196 endif()
197
198 if(WITH_CODEC_QUICKTIME)
199         list(APPEND INC
200                 ../../quicktime
201         )
202         add_definitions(-DWITH_QUICKTIME)
203 endif()
204
205 if(WITH_CODEC_FFMPEG)
206         list(APPEND INC_SYS
207                 ${FFMPEG_INCLUDE_DIRS}
208         )
209         add_definitions(-DWITH_FFMPEG)
210 endif()
211
212 if(WITH_MOD_FLUID)
213         add_definitions(-DWITH_MOD_FLUID)
214 endif()
215
216 if(WITH_FFTW3)
217         add_definitions(-DWITH_FFTW3)
218 endif()
219
220 if(WITH_MOD_SMOKE)
221         add_definitions(-DWITH_SMOKE)
222 endif()
223
224 if(WITH_MOD_OCEANSIM)
225         add_definitions(-DWITH_OCEANSIM)
226 endif()
227
228 if(WITH_SDL)
229         add_definitions(-DWITH_SDL)
230 endif()
231
232 if(WITH_OPENAL)
233         add_definitions(-DWITH_OPENAL)
234 endif()
235
236 if(WITH_JACK)
237         add_definitions(-DWITH_JACK)
238 endif()
239
240 if(WITH_OPENCOLLADA)
241         add_definitions(-DWITH_COLLADA)
242 endif()
243
244 if(WITH_INTERNATIONAL)
245         add_definitions(-DWITH_INTERNATIONAL)
246 endif()
247
248 if(WITH_BULLET)
249         list(APPEND INC
250                 ../../../../intern/rigidbody
251         )
252         add_definitions(-DWITH_BULLET)
253 endif()
254
255 # Build makesrna executable
256 blender_include_dirs(
257         .
258         ..
259         ../../blenkernel
260         ../../blenloader
261         ../../blenlib
262         ../../bmesh
263         ../../blenfont
264         ../../gpu
265         ../../imbuf
266         ../../ikplugin
267         ../../makesdna
268         ../../windowmanager
269         ../../editors/include
270         ../../render/extern/include
271         ../../../../intern/audaspace/intern
272         ../../../../intern/cycles/blender
273         ../../../../intern/guardedalloc
274         ../../../../intern/memutil
275         ../../../../intern/smoke/extern
276 )
277
278 if(WITH_FREESTYLE)
279         blender_include_dirs(
280                 ../../freestyle
281         )
282         add_definitions(-DWITH_FREESTYLE)
283 endif()
284
285 blender_include_dirs_sys(
286         ${GLEW_INCLUDE_PATH}
287 )
288
289 add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
290 target_link_libraries(makesrna bf_dna)
291 target_link_libraries(makesrna bf_dna_blenlib)
292
293 # too many warnings with clang
294 remove_cc_flag("-Wmissing-prototypes")
295
296 # Output rna_*_gen.c
297 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
298 add_custom_command(
299         OUTPUT ${GENSRC}
300         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
301         DEPENDS makesrna
302 )
303
304 # Build bf_rna
305 set(SRC
306         rna_access.c
307         ${GENSRC}
308
309         ${SRC_RNA_INC}
310         rna_internal.h
311         rna_internal_types.h
312         rna_nodetree_types.h
313         rna_mesh_utils.h
314 )
315
316 blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}")