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