07c7767f348b45e61c44baa4c316a0e05b6d8bcb
[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 # ***** END GPL LICENSE BLOCK *****
20
21 set(INC
22   .
23   ../blenfont
24   ../blenlib
25   ../blenloader
26   ../blentranslation
27   ../bmesh
28   ../depsgraph
29   ../draw
30   ../gpencil_modifiers
31   ../gpu
32   ../ikplugin
33   ../imbuf
34   ../makesdna
35   ../makesrna
36   ../modifiers
37   ../nodes
38   ../physics
39   ../shader_fx
40   ../render/extern/include
41   ../../../intern/ghost
42   ../../../intern/glew-mx
43   ../../../intern/guardedalloc
44   ../../../intern/iksolver/extern
45   ../../../intern/atomic
46   ../../../intern/clog
47   ../../../intern/libmv
48   ../../../intern/mantaflow/extern
49   ../../../intern/memutil
50   ../../../intern/mikktspace
51   ../../../intern/opensubdiv
52   ../../../extern/curve_fit_nd
53
54   # dna_type_offsets.h
55   ${CMAKE_CURRENT_BINARY_DIR}/../makesdna/intern
56 )
57
58 set(INC_SYS
59   ${GLEW_INCLUDE_PATH}
60   ${ZLIB_INCLUDE_DIRS}
61 )
62
63 set(SRC
64   ${CMAKE_SOURCE_DIR}/release/datafiles/userdef/userdef_default.c
65   intern/CCGSubSurf.c
66   intern/CCGSubSurf_legacy.c
67   intern/CCGSubSurf_opensubdiv.c
68   intern/CCGSubSurf_opensubdiv_converter.c
69   intern/CCGSubSurf_util.c
70   intern/DerivedMesh.c
71   intern/action.c
72   intern/addon.c
73   intern/anim_data.c
74   intern/anim_path.c
75   intern/anim_sys.c
76   intern/anim_visualization.c
77   intern/appdir.c
78   intern/armature.c
79   intern/armature_update.c
80   intern/autoexec.c
81   intern/blender.c
82   intern/blender_copybuffer.c
83   intern/blender_undo.c
84   intern/blender_user_menu.c
85   intern/blendfile.c
86   intern/boids.c
87   intern/bpath.c
88   intern/brush.c
89   intern/bvhutils.c
90   intern/cachefile.c
91   intern/callbacks.c
92   intern/camera.c
93   intern/cdderivedmesh.c
94   intern/cloth.c
95   intern/collection.c
96   intern/collision.c
97   intern/colorband.c
98   intern/colortools.c
99   intern/constraint.c
100   intern/context.c
101   intern/crazyspace.c
102   intern/curve.c
103   intern/curve_decimate.c
104   intern/curveprofile.c
105   intern/customdata.c
106   intern/customdata_file.c
107   intern/data_transfer.c
108   intern/deform.c
109   intern/displist.c
110   intern/displist_tangent.c
111   intern/dynamicpaint.c
112   intern/editlattice.c
113   intern/editmesh.c
114   intern/editmesh_bvh.c
115   intern/editmesh_cache.c
116   intern/editmesh_tangent.c
117   intern/effect.c
118   intern/fcurve.c
119   intern/fcurve_driver.c
120   intern/fluid.c
121   intern/fmodifier.c
122   intern/font.c
123   intern/freestyle.c
124   intern/gpencil.c
125   intern/gpencil_geom.c
126   intern/gpencil_modifier.c
127   intern/hair.c
128   intern/icons.c
129   intern/icons_rasterize.c
130   intern/idprop.c
131   intern/idprop_utils.c
132   intern/idtype.c
133   intern/image.c
134   intern/image_gen.c
135   intern/image_save.c
136   intern/ipo.c
137   intern/kelvinlet.c
138   intern/key.c
139   intern/keyconfig.c
140   intern/lattice.c
141   intern/layer.c
142   intern/layer_utils.c
143   intern/lib_id.c
144   intern/lib_id_delete.c
145   intern/lib_override.c
146   intern/lib_query.c
147   intern/lib_remap.c
148   intern/library.c
149   intern/light.c
150   intern/lightprobe.c
151   intern/linestyle.c
152   intern/main.c
153   intern/main_idmap.c
154   intern/mask.c
155   intern/mask_evaluate.c
156   intern/mask_rasterize.c
157   intern/material.c
158   intern/mball.c
159   intern/mball_tessellate.c
160   intern/mesh.c
161   intern/mesh_convert.c
162   intern/mesh_evaluate.c
163   intern/mesh_iterators.c
164   intern/mesh_mapping.c
165   intern/mesh_merge.c
166   intern/mesh_mirror.c
167   intern/mesh_remap.c
168   intern/mesh_remesh_voxel.c
169   intern/mesh_runtime.c
170   intern/mesh_tangent.c
171   intern/mesh_validate.c
172   intern/modifier.c
173   intern/movieclip.c
174   intern/multires.c
175   intern/multires_reshape.c
176   intern/multires_reshape_apply_base.c
177   intern/multires_reshape_ccg.c
178   intern/multires_reshape_smooth.c
179   intern/multires_reshape_subdivide.c
180   intern/multires_reshape_util.c
181   intern/multires_reshape_vertcos.c
182   intern/multires_subdiv.c
183   intern/multires_unsubdivide.c
184   intern/nla.c
185   intern/node.c
186   intern/object.c
187   intern/object_deform.c
188   intern/object_dupli.c
189   intern/object_facemap.c
190   intern/object_update.c
191   intern/ocean.c
192   intern/ocean_spectrum.c
193   intern/outliner_treehash.c
194   intern/packedFile.c
195   intern/paint.c
196   intern/paint_toolslots.c
197   intern/particle.c
198   intern/particle_child.c
199   intern/particle_distribute.c
200   intern/particle_system.c
201   intern/pbvh.c
202   intern/pbvh_bmesh.c
203   intern/pointcache.c
204   intern/pointcloud.c
205   intern/report.c
206   intern/rigidbody.c
207   intern/scene.c
208   intern/screen.c
209   intern/seqcache.c
210   intern/seqeffects.c
211   intern/seqmodifier.c
212   intern/seqprefetch.c
213   intern/sequencer.c
214   intern/shader_fx.c
215   intern/shrinkwrap.c
216   intern/simulation.cc
217   intern/softbody.c
218   intern/sound.c
219   intern/speaker.c
220   intern/studiolight.c
221   intern/subdiv.c
222   intern/subdiv_ccg.c
223   intern/subdiv_ccg_mask.c
224   intern/subdiv_ccg_material.c
225   intern/subdiv_converter.c
226   intern/subdiv_converter_mesh.c
227   intern/subdiv_deform.c
228   intern/subdiv_displacement.c
229   intern/subdiv_displacement_multires.c
230   intern/subdiv_eval.c
231   intern/subdiv_foreach.c
232   intern/subdiv_mesh.c
233   intern/subdiv_stats.c
234   intern/subdiv_topology.c
235   intern/subsurf_ccg.c
236   intern/text.c
237   intern/text_suggestions.c
238   intern/texture.c
239   intern/tracking.c
240   intern/tracking_auto.c
241   intern/tracking_detect.c
242   intern/tracking_plane_tracker.c
243   intern/tracking_region_tracker.c
244   intern/tracking_solver.c
245   intern/tracking_stabilize.c
246   intern/tracking_util.c
247   intern/undo_system.c
248   intern/unit.c
249   intern/volume.cc
250   intern/volume_render.cc
251   intern/workspace.c
252   intern/world.c
253   intern/writeavi.c
254
255   BKE_DerivedMesh.h
256   BKE_action.h
257   BKE_addon.h
258   BKE_anim_data.h
259   BKE_anim_path.h
260   BKE_anim_visualization.h
261   BKE_animsys.h
262   BKE_appdir.h
263   BKE_armature.h
264   BKE_autoexec.h
265   BKE_blender.h
266   BKE_blender_copybuffer.h
267   BKE_blender_undo.h
268   BKE_blender_user_menu.h
269   BKE_blender_version.h
270   BKE_blendfile.h
271   BKE_boids.h
272   BKE_bpath.h
273   BKE_brush.h
274   BKE_bvhutils.h
275   BKE_cachefile.h
276   BKE_callbacks.h
277   BKE_camera.h
278   BKE_ccg.h
279   BKE_cdderivedmesh.h
280   BKE_cloth.h
281   BKE_collection.h
282   BKE_collision.h
283   BKE_colorband.h
284   BKE_colortools.h
285   BKE_constraint.h
286   BKE_context.h
287   BKE_crazyspace.h
288   BKE_curve.h
289   BKE_curveprofile.h
290   BKE_customdata.h
291   BKE_customdata_file.h
292   BKE_data_transfer.h
293   BKE_deform.h
294   BKE_displist.h
295   BKE_displist_tangent.h
296   BKE_duplilist.h
297   BKE_dynamicpaint.h
298   BKE_editlattice.h
299   BKE_editmesh.h
300   BKE_editmesh_bvh.h
301   BKE_editmesh_cache.h
302   BKE_editmesh_tangent.h
303   BKE_effect.h
304   BKE_fcurve.h
305   BKE_fcurve_driver.h
306   BKE_fluid.h
307   BKE_font.h
308   BKE_freestyle.h
309   BKE_global.h
310   BKE_gpencil.h
311   BKE_gpencil_geom.h
312   BKE_gpencil_modifier.h
313   BKE_hair.h
314   BKE_icons.h
315   BKE_idprop.h
316   BKE_idtype.h
317   BKE_image.h
318   BKE_ipo.h
319   BKE_kelvinlet.h
320   BKE_key.h
321   BKE_keyconfig.h
322   BKE_lattice.h
323   BKE_layer.h
324   BKE_lib_id.h
325   BKE_lib_override.h
326   BKE_lib_query.h
327   BKE_lib_remap.h
328   BKE_library.h
329   BKE_light.h
330   BKE_lightprobe.h
331   BKE_linestyle.h
332   BKE_main.h
333   BKE_main_idmap.h
334   BKE_mask.h
335   BKE_material.h
336   BKE_mball.h
337   BKE_mball_tessellate.h
338   BKE_mesh.h
339   BKE_mesh_iterators.h
340   BKE_mesh_mapping.h
341   BKE_mesh_mirror.h
342   BKE_mesh_remap.h
343   BKE_mesh_remesh_voxel.h
344   BKE_mesh_runtime.h
345   BKE_mesh_tangent.h
346   BKE_modifier.h
347   BKE_movieclip.h
348   BKE_multires.h
349   BKE_nla.h
350   BKE_node.h
351   BKE_object.h
352   BKE_object_deform.h
353   BKE_object_facemap.h
354   BKE_ocean.h
355   BKE_outliner_treehash.h
356   BKE_packedFile.h
357   BKE_paint.h
358   BKE_particle.h
359   BKE_pbvh.h
360   BKE_pointcache.h
361   BKE_pointcloud.h
362   BKE_report.h
363   BKE_rigidbody.h
364   BKE_scene.h
365   BKE_screen.h
366   BKE_sequencer.h
367   BKE_shader_fx.h
368   BKE_shrinkwrap.h
369   BKE_simulation.h
370   BKE_softbody.h
371   BKE_sound.h
372   BKE_speaker.h
373   BKE_studiolight.h
374   BKE_subdiv.h
375   BKE_subdiv_ccg.h
376   BKE_subdiv_deform.h
377   BKE_subdiv_eval.h
378   BKE_subdiv_foreach.h
379   BKE_subdiv_mesh.h
380   BKE_subdiv_topology.h
381   BKE_subsurf.h
382   BKE_text.h
383   BKE_text_suggestions.h
384   BKE_texture.h
385   BKE_tracking.h
386   BKE_undo_system.h
387   BKE_unit.h
388   BKE_volume.h
389   BKE_volume_render.h
390   BKE_workspace.h
391   BKE_world.h
392   BKE_writeavi.h
393
394   nla_private.h
395   particle_private.h
396   tracking_private.h
397   intern/CCGSubSurf.h
398   intern/CCGSubSurf_inline.h
399   intern/CCGSubSurf_intern.h
400   intern/data_transfer_intern.h
401   intern/lib_intern.h
402   intern/multires_inline.h
403   intern/multires_reshape.h
404   intern/multires_unsubdivide.h
405   intern/pbvh_intern.h
406   intern/subdiv_converter.h
407   intern/subdiv_inline.h
408 )
409
410 set(LIB
411   bf_blenfont
412   bf_blenlib
413   bf_blenloader
414   bf_blentranslation
415   bf_bmesh
416   bf_depsgraph
417   bf_draw
418   bf_gpencil_modifiers
419   bf_gpu
420   bf_ikplugin
421   bf_imbuf
422   bf_intern_clog
423   bf_intern_ghost
424   bf_intern_guardedalloc
425   bf_intern_libmv  # Uses stub when disabled.
426   bf_intern_mikktspace
427   bf_intern_opensubdiv  # Uses stub when disabled.
428   bf_modifiers
429   bf_nodes
430   bf_physics
431   bf_rna
432   bf_shader_fx
433 )
434
435 if(WITH_BINRELOC)
436   list(APPEND INC_SYS
437     ${BINRELOC_INCLUDE_DIRS}
438   )
439   list(APPEND LIB
440     extern_binreloc
441   )
442   add_definitions(-DWITH_BINRELOC)
443 endif()
444
445 add_definitions(${GL_DEFINITIONS})
446
447 if(WIN32)
448   list(APPEND INC
449     ../../../intern/utfconv
450   )
451 endif()
452
453 if(WITH_AUDASPACE)
454   add_definitions(-DWITH_AUDASPACE)
455
456   list(APPEND INC_SYS
457     ${AUDASPACE_C_INCLUDE_DIRS}
458   )
459   list(APPEND LIB
460     ${AUDASPACE_C_LIBRARIES}
461     ${AUDASPACE_PY_LIBRARIES}
462   )
463 endif()
464
465 if(WITH_BULLET)
466   list(APPEND INC_SYS
467     ${BULLET_INCLUDE_DIRS}
468   )
469   list(APPEND INC
470     ../../../intern/rigidbody
471   )
472   list(APPEND LIB
473     bf_intern_rigidbody
474     extern_bullet
475
476     ${BULLET_LIBRARIES}
477   )
478   add_definitions(-DWITH_BULLET)
479 endif()
480
481 if(WITH_IMAGE_OPENEXR)
482   add_definitions(-DWITH_OPENEXR)
483 endif()
484
485 if(WITH_IMAGE_TIFF)
486   add_definitions(-DWITH_TIFF)
487 endif()
488
489 if(WITH_OPENIMAGEIO)
490   add_definitions(-DWITH_OPENIMAGEIO)
491 endif()
492
493 if(WITH_IMAGE_OPENJPEG)
494   add_definitions(-DWITH_OPENJPEG)
495 endif()
496
497 if(WITH_IMAGE_DDS)
498   add_definitions(-DWITH_DDS)
499 endif()
500
501 if(WITH_IMAGE_CINEON)
502   add_definitions(-DWITH_CINEON)
503 endif()
504
505 if(WITH_IMAGE_FRAMESERVER)
506   add_definitions(-DWITH_FRAMESERVER)
507 endif()
508
509 if(WITH_IMAGE_HDR)
510   add_definitions(-DWITH_HDR)
511 endif()
512
513 if(WITH_CODEC_AVI)
514   list(APPEND INC
515     ../io/avi
516   )
517   add_definitions(-DWITH_AVI)
518 endif()
519
520 if(WITH_CODEC_FFMPEG)
521   list(APPEND SRC
522     intern/writeffmpeg.c
523     BKE_writeffmpeg.h
524   )
525   list(APPEND INC
526     ../../../intern/ffmpeg
527   )
528   list(APPEND INC_SYS
529     ${FFMPEG_INCLUDE_DIRS}
530   )
531   list(APPEND LIB
532     ${FFMPEG_LIBRARIES}
533   )
534   add_definitions(-DWITH_FFMPEG)
535
536   remove_strict_c_flags_file(
537     intern/writeffmpeg.c
538   )
539 endif()
540
541 if(WITH_PYTHON)
542   list(APPEND INC
543     ../python
544   )
545   list(APPEND LIB
546     bf_python
547     bf_python_bmesh
548   )
549   add_definitions(-DWITH_PYTHON)
550
551   if(WITH_PYTHON_SAFETY)
552     add_definitions(-DWITH_PYTHON_SAFETY)
553   endif()
554
555   if(WITH_PYTHON_SECURITY)
556     add_definitions(-DWITH_PYTHON_SECURITY)
557   endif()
558
559
560   if(PYTHON_EXECUTABLE)
561     get_filename_component(_python_exe_name ${PYTHON_EXECUTABLE} NAME)
562     add_definitions(-DPYTHON_EXECUTABLE_NAME=${_python_exe_name})
563     unset(_python_exe_name)
564   endif()
565 endif()
566
567 if(WITH_MOD_FLUID)
568   list(APPEND LIB
569     bf_intern_mantaflow
570   )
571   add_definitions(-DWITH_FLUID)
572 endif()
573
574 if(WITH_MOD_OCEANSIM)
575   add_definitions(-DWITH_OCEANSIM)
576 endif()
577
578 if(WITH_JACK)
579   add_definitions(-DWITH_JACK)
580 endif()
581
582 if(WITH_LZO)
583   if(WITH_SYSTEM_LZO)
584     list(APPEND INC_SYS
585       ${LZO_INCLUDE_DIR}
586     )
587     list(APPEND LIB
588       ${LZO_LIBRARIES}
589     )
590     add_definitions(-DWITH_SYSTEM_LZO)
591   else()
592     list(APPEND INC_SYS
593       ../../../extern/lzo/minilzo
594     )
595     list(APPEND LIB
596       extern_minilzo
597     )
598   endif()
599   add_definitions(-DWITH_LZO)
600 endif()
601
602 if(WITH_LZMA)
603   list(APPEND INC_SYS
604     ../../../extern/lzma
605   )
606   list(APPEND LIB
607     extern_lzma
608   )
609   add_definitions(-DWITH_LZMA)
610 endif()
611
612 if(WITH_LIBMV)
613   add_definitions(-DWITH_LIBMV)
614 endif()
615
616 if(WITH_FFTW3)
617   list(APPEND INC_SYS
618     ${FFTW3_INCLUDE_DIRS}
619   )
620   list(APPEND LIB
621     ${FFTW3_LIBRARIES}
622   )
623   add_definitions(-DFFTW3=1)
624 endif()
625
626 if(WITH_INTERNATIONAL)
627   add_definitions(-DWITH_INTERNATIONAL)
628 endif()
629
630 if(WITH_FREESTYLE)
631   add_definitions(-DWITH_FREESTYLE)
632 endif()
633
634 if(WITH_ALEMBIC)
635   list(APPEND INC
636     ../io/alembic
637   )
638   add_definitions(-DWITH_ALEMBIC)
639 endif()
640
641 if(WITH_OPENSUBDIV)
642   list(APPEND INC_SYS
643     ${OPENSUBDIV_INCLUDE_DIRS}
644   )
645   list(APPEND LIB
646     ${OPENSUBDIV_LIBRARIES}
647   )
648   add_definitions(-DWITH_OPENSUBDIV)
649 endif()
650
651 if(WITH_OPENVDB)
652   list(APPEND INC
653      ../../../intern/openvdb
654   )
655   list(APPEND INC_SYS
656     ${OPENVDB_INCLUDE_DIRS}
657   )
658   list(APPEND LIB
659     bf_intern_openvdb
660     ${OPENVDB_LIBRARIES}
661   )
662   add_definitions(-DWITH_OPENVDB ${OPENVDB_DEFINITIONS})
663 endif()
664
665 if(WITH_QUADRIFLOW)
666   list(APPEND INC
667      ../../../intern/quadriflow
668   )
669   list(APPEND LIB
670      bf_intern_quadriflow
671   )
672   add_definitions(-DWITH_QUADRIFLOW)
673 endif()
674
675 if(WITH_XR_OPENXR)
676   add_definitions(-DWITH_XR_OPENXR)
677 endif()
678
679 # # Warnings as errors, this is too strict!
680 # if(MSVC)
681 #    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
682 # endif()
683
684 blender_add_lib(bf_blenkernel "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
685
686 # Needed so we can use dna_type_offsets.h for defaults initialization.
687 add_dependencies(bf_blenkernel bf_dna)