7b6fb30d692dd4f8520592ee949e68850626d647
[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 set(APISRC
97         rna_action_api.c
98         rna_actuator_api.c
99         rna_animation_api.c
100         rna_armature_api.c
101         rna_camera_api.c
102         rna_controller_api.c
103         rna_fcurve_api.c
104         rna_image_api.c
105         rna_main_api.c
106         rna_material_api.c
107         rna_mesh_api.c
108         rna_meta_api.c
109         rna_texture_api.c
110         rna_object_api.c
111         rna_pose_api.c
112         rna_scene_api.c
113         rna_sensor_api.c
114         rna_sequencer_api.c
115         rna_text_api.c
116         rna_ui_api.c
117         rna_wm_api.c
118 )
119
120 string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
121 set_source_files_properties(GENSRC PROPERTIES GENERATED true)
122
123 set(SRC_RNA_INC
124         ../RNA_access.h
125         ../RNA_define.h
126         ../RNA_documentation.h
127         ../RNA_enum_types.h
128         ../RNA_types.h
129 )
130
131 set(SRC
132         makesrna.c
133         rna_define.c
134         ${DEFSRC}
135         ${APISRC}
136         ../../../../intern/guardedalloc/intern/mallocn.c
137         ../../../../intern/guardedalloc/intern/mmap_win.c
138 )
139
140 set(INC
141
142 )
143
144 set(INC_SYS
145
146 )
147
148 if(WITH_CYCLES)
149         add_definitions(-DWITH_CYCLES)
150 endif()
151
152 if(WITH_PYTHON)
153         add_definitions(-DWITH_PYTHON)
154 endif()
155
156 if(WITH_GAMEENGINE)
157         add_definitions(-DWITH_GAMEENGINE)
158 endif()
159
160 if(WITH_IMAGE_OPENEXR)
161         add_definitions(-DWITH_OPENEXR)
162 endif()
163
164 if(WITH_IMAGE_TIFF)
165         add_definitions(-DWITH_TIFF)
166 endif()
167
168 if(WITH_IMAGE_OPENJPEG)
169         add_definitions(-DWITH_OPENJPEG)
170 endif()
171
172 if(WITH_IMAGE_DDS)
173         add_definitions(-DWITH_DDS)
174 endif()
175
176 if(WITH_IMAGE_CINEON)
177         add_definitions(-DWITH_CINEON)
178 endif()
179
180 if(WITH_IMAGE_HDR)
181         add_definitions(-DWITH_HDR)
182 endif()
183
184 if(WITH_IMAGE_FRAMESERVER)
185         add_definitions(-DWITH_FRAMESERVER)
186 endif()
187
188 if(WITH_AUDASPACE)
189         add_definitions(-DWITH_AUDASPACE)
190 endif()
191
192 if(WITH_CODEC_QUICKTIME)
193         list(APPEND INC
194                 ../../quicktime
195         )
196         add_definitions(-DWITH_QUICKTIME)
197 endif()
198
199 if(WITH_CODEC_FFMPEG)
200         list(APPEND INC_SYS
201                 ${FFMPEG_INCLUDE_DIRS}
202         )
203         add_definitions(-DWITH_FFMPEG)
204 endif()
205
206 if(WITH_MOD_FLUID)
207         add_definitions(-DWITH_MOD_FLUID)
208 endif()
209
210 if(WITH_FFTW3)
211         add_definitions(-DWITH_FFTW3)
212 endif()
213
214 if(WITH_MOD_SMOKE)
215         add_definitions(-DWITH_SMOKE)
216 endif()
217
218 if(WITH_MOD_OCEANSIM)
219         add_definitions(-DWITH_OCEANSIM)
220 endif()
221
222 if(WITH_SDL)
223         add_definitions(-DWITH_SDL)
224 endif()
225
226 if(WITH_OPENAL)
227         add_definitions(-DWITH_OPENAL)
228 endif()
229
230 if(WITH_JACK)
231         add_definitions(-DWITH_JACK)
232 endif()
233
234 if(WITH_OPENCOLLADA)
235         add_definitions(-DWITH_COLLADA)
236 endif()
237
238 if(WITH_INTERNATIONAL)
239         add_definitions(-DWITH_INTERNATIONAL)
240 endif()
241
242 if(WITH_BULLET)
243         list(APPEND INC
244                 ../../../../intern/rigidbody
245         )
246         add_definitions(-DWITH_BULLET)
247 endif()
248
249 # Build makesrna executable
250 blender_include_dirs(
251         .
252         ..
253         ../../blenkernel
254         ../../blenloader
255         ../../blenlib
256         ../../bmesh
257         ../../blenfont
258         ../../gpu
259         ../../imbuf
260         ../../ikplugin
261         ../../makesdna
262         ../../windowmanager
263         ../../editors/include
264         ../../render/extern/include
265         ../../../../intern/audaspace/intern
266         ../../../../intern/cycles/blender
267         ../../../../intern/guardedalloc
268         ../../../../intern/memutil
269         ../../../../intern/smoke/extern
270 )
271
272 blender_include_dirs_sys(
273         ${GLEW_INCLUDE_PATH}
274 )
275
276 add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
277 target_link_libraries(makesrna bf_dna)
278 target_link_libraries(makesrna bf_dna_blenlib)
279
280 # Output rna_*_gen.c
281 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
282 add_custom_command(
283         OUTPUT ${GENSRC}
284         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
285         DEPENDS makesrna
286 )
287
288 # Build bf_rna
289 set(SRC
290         rna_access.c
291         ${GENSRC}
292
293         ${SRC_RNA_INC}
294         rna_internal.h
295         rna_internal_types.h
296         rna_nodetree_types.h
297         rna_mesh_utils.h
298 )
299
300 blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}")