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