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