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