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