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