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