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