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