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