Merge remote-tracking branch 'origin/master' into blender2.8
[blender.git] / source / blender / blenkernel / 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 set(INC
27         .
28         ../blenfont
29         ../blenlib
30         ../blenloader
31         ../blentranslation
32         ../depsgraph
33         ../draw
34         ../gpu
35         ../ikplugin
36         ../imbuf
37         ../makesdna
38         ../makesrna
39         ../bmesh
40         ../modifiers
41         ../gpencil_modifiers
42         ../shader_fx
43         ../nodes
44         ../physics
45         ../render/extern/include
46         ../../../intern/ghost
47         ../../../intern/guardedalloc
48         ../../../intern/glew-mx
49         ../../../intern/iksolver/extern
50         ../../../intern/memutil
51         ../../../intern/mikktspace
52         ../../../intern/smoke/extern
53         ../../../intern/atomic
54         ../../../intern/clog
55         ../../../intern/libmv
56         ../../../intern/opensubdiv
57         ../../../extern/curve_fit_nd
58 )
59
60 set(INC_SYS
61         ${GLEW_INCLUDE_PATH}
62         ${ZLIB_INCLUDE_DIRS}
63 )
64
65 set(SRC
66         intern/CCGSubSurf.c
67         intern/CCGSubSurf_legacy.c
68         intern/CCGSubSurf_opensubdiv.c
69         intern/CCGSubSurf_opensubdiv_converter.c
70         intern/CCGSubSurf_util.c
71         intern/DerivedMesh.c
72         intern/action.c
73         intern/addon.c
74         intern/anim.c
75         intern/anim_sys.c
76         intern/appdir.c
77         intern/armature.c
78         intern/armature_update.c
79         intern/autoexec.c
80         intern/blender.c
81         intern/blender_copybuffer.c
82         intern/blender_undo.c
83         intern/blender_user_menu.c
84         intern/blendfile.c
85         intern/boids.c
86         intern/bpath.c
87         intern/brush.c
88         intern/bvhutils.c
89         intern/cachefile.c
90         intern/camera.c
91         intern/cdderivedmesh.c
92         intern/cloth.c
93         intern/collection.c
94         intern/collision.c
95         intern/colorband.c
96         intern/colortools.c
97         intern/constraint.c
98         intern/context.c
99         intern/crazyspace.c
100         intern/curve.c
101         intern/curve_decimate.c
102         intern/customdata.c
103         intern/customdata_file.c
104         intern/data_transfer.c
105         intern/deform.c
106         intern/displist.c
107         intern/dynamicpaint.c
108         intern/editderivedmesh.c
109         intern/editlattice.c
110         intern/editmesh.c
111         intern/editmesh_bvh.c
112         intern/editmesh_cache.c
113         intern/editmesh_tangent.c
114         intern/effect.c
115         intern/fcurve.c
116         intern/fluidsim.c
117         intern/fmodifier.c
118         intern/font.c
119         intern/freestyle.c
120         intern/gpencil.c
121         intern/gpencil_modifier.c
122         intern/icons.c
123         intern/icons_rasterize.c
124         intern/idcode.c
125         intern/idprop.c
126         intern/idprop_utils.c
127         intern/image.c
128         intern/image_gen.c
129         intern/ipo.c
130         intern/key.c
131         intern/keyconfig.c
132         intern/lamp.c
133         intern/lattice.c
134         intern/library.c
135         intern/library_idmap.c
136         intern/library_override.c
137         intern/library_query.c
138         intern/library_remap.c
139         intern/linestyle.c
140         intern/main.c
141         intern/mask.c
142         intern/mask_evaluate.c
143         intern/mask_rasterize.c
144         intern/material.c
145         intern/mball.c
146         intern/mball_tessellate.c
147         intern/mesh.c
148         intern/mesh_convert.c
149         intern/mesh_evaluate.c
150         intern/mesh_iterators.c
151         intern/mesh_mapping.c
152         intern/mesh_merge.c
153         intern/mesh_remap.c
154         intern/mesh_runtime.c
155         intern/mesh_tangent.c
156         intern/mesh_validate.c
157         intern/modifier.c
158         intern/movieclip.c
159         intern/multires.c
160         intern/multires_reshape.c
161         intern/multires_subdiv.c
162         intern/nla.c
163         intern/node.c
164         intern/object.c
165         intern/object_facemap.c
166         intern/object_deform.c
167         intern/object_dupli.c
168         intern/object_update.c
169         intern/ocean.c
170         intern/outliner_treehash.c
171         intern/packedFile.c
172         intern/paint.c
173         intern/paint_toolslots.c
174         intern/particle.c
175         intern/particle_child.c
176         intern/particle_distribute.c
177         intern/particle_system.c
178         intern/pbvh.c
179         intern/pbvh_bmesh.c
180         intern/pointcache.c
181         intern/layer.c
182         intern/layer_utils.c
183         intern/lightprobe.c
184         intern/report.c
185         intern/rigidbody.c
186         intern/scene.c
187         intern/screen.c
188         intern/seqcache.c
189         intern/seqeffects.c
190         intern/seqmodifier.c
191         intern/sequencer.c
192         intern/shader_fx.c
193         intern/shrinkwrap.c
194         intern/smoke.c
195         intern/softbody.c
196         intern/sound.c
197         intern/speaker.c
198         intern/studiolight.c
199         intern/subdiv.c
200         intern/subdiv_ccg.c
201         intern/subdiv_ccg_mask.c
202         intern/subdiv_converter.c
203         intern/subdiv_converter_mesh.c
204         intern/subdiv_displacement.c
205         intern/subdiv_displacement_multires.c
206         intern/subdiv_eval.c
207         intern/subdiv_foreach.c
208         intern/subdiv_mesh.c
209         intern/subdiv_stats.c
210         intern/subsurf_ccg.c
211         intern/suggestions.c
212         intern/text.c
213         intern/texture.c
214         intern/tracking.c
215         intern/tracking_auto.c
216         intern/tracking_detect.c
217         intern/tracking_plane_tracker.c
218         intern/tracking_region_tracker.c
219         intern/tracking_solver.c
220         intern/tracking_stabilize.c
221         intern/tracking_util.c
222         intern/undo_system.c
223         intern/unit.c
224         intern/workspace.c
225         intern/world.c
226         intern/writeavi.c
227
228         BKE_DerivedMesh.h
229         BKE_action.h
230         BKE_addon.h
231         BKE_anim.h
232         BKE_animsys.h
233         BKE_appdir.h
234         BKE_armature.h
235         BKE_autoexec.h
236         BKE_blender.h
237         BKE_blender_copybuffer.h
238         BKE_blender_undo.h
239         BKE_blender_user_menu.h
240         BKE_blender_version.h
241         BKE_blendfile.h
242         BKE_boids.h
243         BKE_bpath.h
244         BKE_brush.h
245         BKE_bvhutils.h
246         BKE_cachefile.h
247         BKE_camera.h
248         BKE_ccg.h
249         BKE_cdderivedmesh.h
250         BKE_cloth.h
251         BKE_collection.h
252         BKE_collision.h
253         BKE_colorband.h
254         BKE_colortools.h
255         BKE_constraint.h
256         BKE_context.h
257         BKE_crazyspace.h
258         BKE_curve.h
259         BKE_customdata.h
260         BKE_customdata_file.h
261         BKE_data_transfer.h
262         BKE_deform.h
263         BKE_displist.h
264         BKE_dynamicpaint.h
265         BKE_editlattice.h
266         BKE_editmesh.h
267         BKE_editmesh_bvh.h
268         BKE_editmesh_cache.h
269         BKE_editmesh_tangent.h
270         BKE_effect.h
271         BKE_fcurve.h
272         BKE_fluidsim.h
273         BKE_font.h
274         BKE_freestyle.h
275         BKE_global.h
276         BKE_gpencil.h
277         BKE_gpencil_modifier.h
278         BKE_icons.h
279         BKE_idcode.h
280         BKE_idprop.h
281         BKE_image.h
282         BKE_ipo.h
283         BKE_key.h
284         BKE_keyconfig.h
285         BKE_lamp.h
286         BKE_lattice.h
287         BKE_library.h
288         BKE_library_idmap.h
289         BKE_library_override.h
290         BKE_library_query.h
291         BKE_library_remap.h
292         BKE_linestyle.h
293         BKE_main.h
294         BKE_mask.h
295         BKE_material.h
296         BKE_mball.h
297         BKE_mball_tessellate.h
298         BKE_mesh.h
299         BKE_mesh_iterators.h
300         BKE_mesh_mapping.h
301         BKE_mesh_remap.h
302         BKE_mesh_runtime.h
303         BKE_mesh_tangent.h
304         BKE_modifier.h
305         BKE_movieclip.h
306         BKE_multires.h
307         BKE_nla.h
308         BKE_node.h
309         BKE_object.h
310         BKE_object_facemap.h
311         BKE_object_deform.h
312         BKE_ocean.h
313         BKE_outliner_treehash.h
314         BKE_packedFile.h
315         BKE_paint.h
316         BKE_particle.h
317         BKE_pbvh.h
318         BKE_pointcache.h
319         BKE_layer.h
320         BKE_lightprobe.h
321         BKE_report.h
322         BKE_rigidbody.h
323         BKE_scene.h
324         BKE_screen.h
325         BKE_sequencer.h
326         BKE_shader_fx.h
327         BKE_shrinkwrap.h
328         BKE_smoke.h
329         BKE_softbody.h
330         BKE_sound.h
331         BKE_speaker.h
332         BKE_studiolight.h
333         BKE_subdiv.h
334         BKE_subdiv_ccg.h
335         BKE_subdiv_eval.h
336         BKE_subdiv_foreach.h
337         BKE_subdiv_mesh.h
338         BKE_subsurf.h
339         BKE_suggestions.h
340         BKE_text.h
341         BKE_texture.h
342         BKE_tracking.h
343         BKE_undo_system.h
344         BKE_unit.h
345         BKE_workspace.h
346         BKE_world.h
347         BKE_writeavi.h
348
349         nla_private.h
350         particle_private.h
351         tracking_private.h
352         intern/CCGSubSurf.h
353         intern/CCGSubSurf_inline.h
354         intern/CCGSubSurf_intern.h
355         intern/data_transfer_intern.h
356         intern/multires_inline.h
357         intern/pbvh_intern.h
358         intern/subdiv_converter.h
359         intern/subdiv_inline.h
360 )
361
362 if(WITH_BINRELOC)
363         list(APPEND INC_SYS
364                 ${BINRELOC_INCLUDE_DIRS}
365         )
366         add_definitions(-DWITH_BINRELOC)
367 endif()
368
369 add_definitions(${GL_DEFINITIONS})
370
371 if(WIN32)
372         list(APPEND INC
373                 ../../../intern/utfconv
374         )
375 endif()
376
377 if(WITH_AUDASPACE)
378         add_definitions(-DWITH_AUDASPACE)
379
380         list(APPEND INC_SYS
381                 ${AUDASPACE_C_INCLUDE_DIRS}
382         )
383 endif()
384
385 if(WITH_BULLET)
386         list(APPEND INC_SYS
387                 ${BULLET_INCLUDE_DIRS}
388         )
389         list(APPEND INC
390                 ../../../intern/rigidbody
391         )
392         add_definitions(-DWITH_BULLET)
393 endif()
394
395 #if(WITH_MOD_CLOTH_ELTOPO)
396 #       list(APPEND INC
397 #               ../../../extern/eltopo
398 #               ../../../extern/eltopo/eltopo3d
399 #       )
400 #       add_definitions(-DWITH_ELTOPO)
401 #endif()
402
403 if(WITH_IMAGE_OPENEXR)
404         add_definitions(-DWITH_OPENEXR)
405 endif()
406
407 if(WITH_IMAGE_TIFF)
408         add_definitions(-DWITH_TIFF)
409 endif()
410
411 if(WITH_OPENIMAGEIO)
412         add_definitions(-DWITH_OPENIMAGEIO)
413 endif()
414
415 if(WITH_IMAGE_OPENJPEG)
416         add_definitions(-DWITH_OPENJPEG)
417 endif()
418
419 if(WITH_IMAGE_DDS)
420         add_definitions(-DWITH_DDS)
421 endif()
422
423 if(WITH_IMAGE_CINEON)
424         add_definitions(-DWITH_CINEON)
425 endif()
426
427 if(WITH_IMAGE_FRAMESERVER)
428         add_definitions(-DWITH_FRAMESERVER)
429 endif()
430
431 if(WITH_IMAGE_HDR)
432         add_definitions(-DWITH_HDR)
433 endif()
434
435 if(WITH_CODEC_AVI)
436         list(APPEND INC
437                 ../avi
438         )
439         add_definitions(-DWITH_AVI)
440 endif()
441
442 if(WITH_CODEC_FFMPEG)
443         list(APPEND SRC
444                 intern/writeffmpeg.c
445                 BKE_writeffmpeg.h
446         )
447         list(APPEND INC
448                 ../../../intern/ffmpeg
449         )
450         list(APPEND INC_SYS
451                 ${FFMPEG_INCLUDE_DIRS}
452         )
453         add_definitions(-DWITH_FFMPEG)
454
455         remove_strict_c_flags_file(
456                 intern/writeffmpeg.c
457         )
458 endif()
459
460 if(WITH_PYTHON)
461         list(APPEND INC
462                 ../python
463         )
464         add_definitions(-DWITH_PYTHON)
465
466         if(WITH_PYTHON_SAFETY)
467                 add_definitions(-DWITH_PYTHON_SAFETY)
468         endif()
469
470         if(WITH_PYTHON_SECURITY)
471                 add_definitions(-DWITH_PYTHON_SECURITY)
472         endif()
473
474
475         if(PYTHON_EXECUTABLE)
476                 get_filename_component(_python_exe_name ${PYTHON_EXECUTABLE} NAME)
477                 add_definitions(-DPYTHON_EXECUTABLE_NAME=${_python_exe_name})
478                 unset(_python_exe_name)
479         endif()
480 endif()
481
482 if(WITH_MOD_FLUID)
483         list(APPEND INC
484                 ../../../intern/elbeem/extern
485         )
486         add_definitions(-DWITH_MOD_FLUID)
487 endif()
488
489 if(WITH_MOD_SMOKE)
490         add_definitions(-DWITH_SMOKE)
491 endif()
492
493 if(WITH_MOD_OCEANSIM)
494         add_definitions(-DWITH_OCEANSIM)
495 endif()
496
497 if(WITH_JACK)
498         add_definitions(-DWITH_JACK)
499 endif()
500
501 if(WITH_LZO)
502         if(WITH_SYSTEM_LZO)
503                 list(APPEND INC_SYS
504                         ${LZO_INCLUDE_DIR}
505                 )
506                 add_definitions(-DWITH_SYSTEM_LZO)
507         else()
508                 list(APPEND INC_SYS
509                         ../../../extern/lzo/minilzo
510                 )
511         endif()
512         add_definitions(-DWITH_LZO)
513 endif()
514
515 if(WITH_LZMA)
516         list(APPEND INC_SYS
517                 ../../../extern/lzma
518         )
519         add_definitions(-DWITH_LZMA)
520 endif()
521
522 if(WITH_LIBMV)
523         add_definitions(-DWITH_LIBMV)
524 endif()
525
526 if(WITH_FFTW3)
527         list(APPEND INC_SYS
528                 ${FFTW3_INCLUDE_DIRS}
529         )
530         add_definitions(-DFFTW3=1)
531 endif()
532
533 if(WITH_INTERNATIONAL)
534         add_definitions(-DWITH_INTERNATIONAL)
535 endif()
536
537 if(WITH_FREESTYLE)
538         add_definitions(-DWITH_FREESTYLE)
539 endif()
540
541 if(WITH_ALEMBIC)
542         list(APPEND INC
543                 ../alembic
544         )
545         add_definitions(-DWITH_ALEMBIC)
546 endif()
547
548 if(WITH_OPENSUBDIV)
549         add_definitions(-DWITH_OPENSUBDIV)
550         list(APPEND INC_SYS
551                 ${OPENSUBDIV_INCLUDE_DIRS}
552         )
553 endif()
554
555 if(WITH_OPENVDB)
556         add_definitions(-DWITH_OPENVDB)
557         list(APPEND INC
558                  ../../../intern/openvdb
559         )
560
561         if(WITH_OPENVDB_BLOSC)
562                 add_definitions(
563                         -DWITH_OPENVDB_BLOSC
564                 )
565         endif()
566 endif()
567
568 ## Warnings as errors, this is too strict!
569 #if(MSVC)
570 #       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
571 #endif()
572
573 blender_add_lib(bf_blenkernel "${SRC}" "${INC}" "${INC_SYS}")