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