OpenGL: transition to ARB FBOs, remove runtime checks
[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 # 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_brush.c
40         rna_camera.c
41         rna_cloth.c
42         rna_color.c
43         rna_constraint.c
44         rna_context.c
45         rna_controller.c
46         rna_curve.c
47         rna_depsgraph.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_linestyle.c
58         rna_main.c
59         rna_mask.c
60         rna_material.c
61         rna_mesh.c
62         rna_meta.c
63         rna_modifier.c
64         rna_movieclip.c
65         rna_nla.c
66         rna_nodetree.c
67         rna_object.c
68         rna_object_force.c
69         rna_packedfile.c
70         rna_palette.c
71         rna_pose.c
72         rna_property.c
73         rna_render.c
74         rna_rigidbody.c
75         rna_rna.c
76         rna_scene.c
77         rna_screen.c
78         rna_sculpt_paint.c
79         rna_sensor.c
80         rna_sequencer.c
81         rna_smoke.c
82         rna_sound.c
83         rna_space.c
84         rna_speaker.c
85         rna_test.c
86         rna_text.c
87         rna_texture.c
88         rna_timeline.c
89         rna_tracking.c
90         rna_ui.c
91         rna_userdef.c
92         rna_vfont.c
93         rna_wm.c
94         rna_world.c
95 )
96
97 set(APISRC
98         rna_action_api.c
99         rna_actuator_api.c
100         rna_animation_api.c
101         rna_armature_api.c
102         rna_camera_api.c
103         rna_controller_api.c
104         rna_curve_api.c
105         rna_fcurve_api.c
106         rna_image_api.c
107         rna_lattice_api.c
108         rna_main_api.c
109         rna_material_api.c
110         rna_mesh_api.c
111         rna_meta_api.c
112         rna_texture_api.c
113         rna_object_api.c
114         rna_pose_api.c
115         rna_scene_api.c
116         rna_sensor_api.c
117         rna_sequencer_api.c
118         rna_sound_api.c
119         rna_space_api.c
120         rna_text_api.c
121         rna_ui_api.c
122         rna_vfont_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 list(APPEND GENSRC
128         "${CMAKE_CURRENT_BINARY_DIR}/rna_prototypes_gen.h"
129 )
130 set_source_files_properties(${GENSRC} PROPERTIES GENERATED TRUE)
131
132 # --------------------------
133 # CFLAGS for Generated Files
134 #
135 # less strict flags for generated source
136 set(GENSRC_CFLAGS)
137 if(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
138         set(GENSRC_CFLAGS "-Wno-missing-prototypes")
139 endif()
140
141 if(GENSRC_CFLAGS)
142         set_source_files_properties(${GENSRC} PROPERTIES COMPILE_FLAGS "${GENSRC_CFLAGS}")
143 endif()
144 unset(GENSRC_CFLAGS)
145
146
147 set(SRC_RNA_INC
148         ../RNA_access.h
149         ../RNA_define.h
150         ../RNA_documentation.h
151         ../RNA_enum_types.h
152         ../RNA_types.h
153 )
154
155 set(SRC
156         makesrna.c
157         rna_define.c
158         ${DEFSRC}
159         ${APISRC}
160         ../../../../intern/guardedalloc/intern/mallocn.c
161         ../../../../intern/guardedalloc/intern/mallocn_guarded_impl.c
162         ../../../../intern/guardedalloc/intern/mallocn_lockfree_impl.c
163         ../../../../intern/guardedalloc/intern/mmap_win.c
164 )
165
166 set(INC
167
168 )
169
170 set(INC_SYS
171
172 )
173
174 if(WITH_CYCLES)
175         add_definitions(-DWITH_CYCLES)
176         if(WITH_CYCLES_DEBUG)
177                 add_definitions(-DWITH_CYCLES_DEBUG)
178         endif()
179 endif()
180
181 if(WITH_PYTHON)
182         add_definitions(-DWITH_PYTHON)
183         list(APPEND INC
184                 ../../python
185         )
186 endif()
187
188 if(WITH_GAMEENGINE)
189         add_definitions(-DWITH_GAMEENGINE)
190 endif()
191
192 if(WITH_IMAGE_OPENEXR)
193         add_definitions(-DWITH_OPENEXR)
194 endif()
195
196 if(WITH_OPENIMAGEIO)
197         add_definitions(-DWITH_OPENIMAGEIO)
198 endif()
199
200 if(WITH_IMAGE_TIFF)
201         add_definitions(-DWITH_TIFF)
202 endif()
203
204 if(WITH_IMAGE_OPENJPEG)
205         add_definitions(-DWITH_OPENJPEG)
206 endif()
207
208 if(WITH_IMAGE_DDS)
209         add_definitions(-DWITH_DDS)
210 endif()
211
212 if(WITH_IMAGE_CINEON)
213         add_definitions(-DWITH_CINEON)
214 endif()
215
216 if(WITH_IMAGE_HDR)
217         add_definitions(-DWITH_HDR)
218 endif()
219
220 if(WITH_IMAGE_FRAMESERVER)
221         add_definitions(-DWITH_FRAMESERVER)
222 endif()
223
224 if(WITH_AUDASPACE)
225         add_definitions(${AUDASPACE_DEFINITIONS})
226
227         list(APPEND INC_SYS
228                 ${AUDASPACE_C_INCLUDE_DIRS}
229         )
230 endif()
231
232 if(WITH_CODEC_QUICKTIME)
233         list(APPEND INC
234                 ../../quicktime
235         )
236         add_definitions(-DWITH_QUICKTIME)
237 endif()
238
239 if(WITH_CODEC_FFMPEG)
240         list(APPEND INC
241                 ../../../../intern/ffmpeg
242         )
243         list(APPEND INC_SYS
244                 ${FFMPEG_INCLUDE_DIRS}
245         )
246         add_definitions(-DWITH_FFMPEG)
247 endif()
248
249 if(WITH_MOD_FLUID)
250         add_definitions(-DWITH_MOD_FLUID)
251 endif()
252
253 if(WITH_FFTW3)
254         add_definitions(-DWITH_FFTW3)
255 endif()
256
257 if(WITH_MOD_SMOKE)
258         add_definitions(-DWITH_SMOKE)
259 endif()
260
261 if(WITH_MOD_OCEANSIM)
262         add_definitions(-DWITH_OCEANSIM)
263 endif()
264
265 if(WITH_SDL)
266         if(WITH_SDL_DYNLOAD)
267                 add_definitions(-DWITH_SDL_DYNLOAD)
268                 list(APPEND INC
269                         ../../../../extern/sdlew/include
270                 )
271         endif()
272         add_definitions(-DWITH_SDL)
273 endif()
274
275 if(WITH_OPENAL)
276         add_definitions(-DWITH_OPENAL)
277 endif()
278
279 if(WITH_JACK)
280         add_definitions(-DWITH_JACK)
281 endif()
282
283 if(WITH_OPENCOLLADA)
284         add_definitions(-DWITH_COLLADA)
285 endif()
286
287 if(WITH_INTERNATIONAL)
288         add_definitions(-DWITH_INTERNATIONAL)
289 endif()
290
291 if(WITH_BULLET)
292         list(APPEND INC
293                 ../../../../intern/rigidbody
294         )
295         add_definitions(-DWITH_BULLET)
296 endif()
297
298 if(WITH_FREESTYLE)
299         list(APPEND INC
300                 ../../freestyle
301         )
302         add_definitions(-DWITH_FREESTYLE)
303 endif()
304
305 if(WITH_OPENSUBDIV)
306         list(APPEND INC
307                 ../../../../intern/opensubdiv
308         )
309         add_definitions(-DWITH_OPENSUBDIV)
310 endif()
311
312 if(WITH_OPENVDB)
313         add_definitions(-DWITH_OPENVDB)
314
315         if(WITH_OPENVDB_BLOSC)
316                 add_definitions(-DWITH_OPENVDB_BLOSC)
317         endif()
318 endif()
319
320 # Build makesrna executable
321 blender_include_dirs(
322         .
323         ..
324         ../../blenfont
325         ../../blenkernel
326         ../../blenlib
327         ../../bmesh
328         ../../blentranslation
329         ../../depsgraph
330         ../../gpu
331         ../../imbuf
332         ../../ikplugin
333         ../../makesdna
334         ../../nodes/
335         ../../physics
336         ../../windowmanager
337         ../../editors/include
338         ../../render/extern/include
339         ../../../../intern/cycles/blender
340         ../../../../intern/guardedalloc
341         ../../../../intern/glew-mx
342         ../../../../intern/atomic
343         ../../../../intern/memutil
344         ../../../../intern/smoke/extern
345 )
346
347 blender_include_dirs_sys(
348         "${GLEW_INCLUDE_PATH}"
349 )
350
351 add_cc_flags_custom_test(makesrna)
352
353 add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
354
355 target_link_libraries(makesrna bf_dna)
356 target_link_libraries(makesrna bf_dna_blenlib)
357
358 # Output rna_*_gen.c
359 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
360 add_custom_command(
361         OUTPUT ${GENSRC}
362         COMMAND "$<TARGET_FILE:makesrna>" ${CMAKE_CURRENT_BINARY_DIR}/
363         DEPENDS makesrna
364 )
365
366 # Build bf_rna
367 set(SRC
368         rna_access.c
369         ${GENSRC}
370
371         ${SRC_RNA_INC}
372         rna_internal.h
373         rna_internal_types.h
374         rna_mesh_utils.h
375 )
376
377 add_definitions(${GL_DEFINITIONS})
378
379 blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}")