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