OpenSubdiv: Commit of OpenSubdiv integration into Blender
[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         ../depsgraph
32         ../gpu
33         ../ikplugin
34         ../imbuf
35         ../makesdna
36         ../makesrna
37         ../bmesh
38         ../modifiers
39         ../nodes
40         ../physics
41         ../render/extern/include
42         ../../../intern/ghost
43         ../../../intern/guardedalloc
44         ../../../intern/glew-mx
45         ../../../intern/iksolver/extern
46         ../../../intern/memutil
47         ../../../intern/mikktspace
48         ../../../intern/raskter
49         ../../../intern/smoke/extern
50         ../../../intern/atomic
51         ../../../extern/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         list(APPEND INC
315                 ../../../intern/audaspace/intern
316         )
317         add_definitions(-DWITH_AUDASPACE)
318 endif()
319
320 if(WITH_BULLET)
321         list(APPEND INC_SYS
322                 ${BULLET_INCLUDE_DIRS}
323         )
324         list(APPEND INC
325                 ../../../intern/rigidbody
326         )
327         add_definitions(-DWITH_BULLET)
328 endif()
329
330 #if(WITH_MOD_CLOTH_ELTOPO)
331 #       list(APPEND INC
332 #               ../../../extern/eltopo
333 #               ../../../extern/eltopo/eltopo3d
334 #       )
335 #       add_definitions(-DWITH_ELTOPO)
336 #endif()
337
338 if(WITH_IMAGE_OPENEXR)
339         add_definitions(-DWITH_OPENEXR)
340 endif()
341
342 if(WITH_IMAGE_TIFF)
343         add_definitions(-DWITH_TIFF)
344 endif()
345
346 if(WITH_OPENIMAGEIO)
347         add_definitions(-DWITH_OPENIMAGEIO)
348 endif()
349
350 if(WITH_IMAGE_OPENJPEG)
351         add_definitions(-DWITH_OPENJPEG)
352 endif()
353
354 if(WITH_IMAGE_DDS)
355         add_definitions(-DWITH_DDS)
356 endif()
357
358 if(WITH_IMAGE_CINEON)
359         add_definitions(-DWITH_CINEON)
360 endif()
361
362 if(WITH_IMAGE_FRAMESERVER)
363         add_definitions(-DWITH_FRAMESERVER)
364 endif()
365
366 if(WITH_IMAGE_HDR)
367         add_definitions(-DWITH_HDR)
368 endif()
369
370 if(WITH_CODEC_AVI)
371         list(APPEND INC
372                 ../avi
373         )
374         add_definitions(-DWITH_AVI)
375 endif()
376
377 if(WITH_CODEC_QUICKTIME)
378         list(APPEND INC
379                 ../quicktime
380         )
381         list(APPEND INC_SYS
382                 ${QUICKTIME_INCLUDE_DIRS}
383         )
384         add_definitions(-DWITH_QUICKTIME)
385 endif()
386
387 if(WITH_CODEC_FFMPEG)
388         list(APPEND SRC
389                 intern/writeffmpeg.c
390                 BKE_writeffmpeg.h
391         )
392         list(APPEND INC
393                 ../../../intern/ffmpeg
394         )
395         list(APPEND INC_SYS
396                 ${FFMPEG_INCLUDE_DIRS}
397         )
398         add_definitions(-DWITH_FFMPEG)
399
400         remove_strict_flags_file(
401                 intern/writeffmpeg.c
402         )
403 endif()
404
405 if(WITH_PYTHON)
406         list(APPEND INC
407                 ../python
408         )
409         add_definitions(-DWITH_PYTHON)
410
411         if(WITH_PYTHON_SECURITY)
412                 add_definitions(-DWITH_PYTHON_SECURITY)
413         endif()
414 endif()
415
416 if(WITH_MOD_FLUID)
417         list(APPEND INC
418                 ../../../intern/elbeem/extern
419         )
420         add_definitions(-DWITH_MOD_FLUID)
421 endif()
422
423 if(WITH_MOD_SMOKE)
424         add_definitions(-DWITH_SMOKE)
425 endif()
426
427 if(WITH_MOD_OCEANSIM)
428         add_definitions(-DWITH_OCEANSIM)
429 endif()
430
431 if(WITH_JACK)
432         add_definitions(-DWITH_JACK)
433 endif()
434
435 if(WITH_LZO)
436         if(WITH_SYSTEM_LZO)
437                 list(APPEND INC_SYS
438                         ${LZO_INCLUDE_DIR}
439                 )
440                 add_definitions(-DWITH_SYSTEM_LZO)
441         else()
442                 list(APPEND INC_SYS
443                         ../../../extern/lzo/minilzo
444                 )
445         endif()
446         add_definitions(-DWITH_LZO)
447 endif()
448
449 if(WITH_LZMA)
450         list(APPEND INC_SYS
451                 ../../../extern/lzma
452         )
453         add_definitions(-DWITH_LZMA)
454 endif()
455
456 if(WITH_GAMEENGINE)
457         list(APPEND INC_SYS
458                 ../../../extern/recastnavigation
459         )
460         list(APPEND SRC
461                 intern/navmesh_conversion.c
462                 BKE_navmesh_conversion.h
463         )
464
465         add_definitions(-DWITH_GAMEENGINE)
466 endif()
467
468 if(WITH_LIBMV)
469         add_definitions(-DWITH_LIBMV)
470 endif()
471
472 if(WITH_LIBMV_WERROR)
473         if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
474                 set_source_files_properties(intern/tracking.c
475                                             intern/tracking_auto.c
476                                             intern/tracking_detect.c
477                                             intern/tracking_plane_tracker.c
478                                             intern/tracking_region_tracker.c
479                                             intern/tracking_solver.c
480                                             intern/tracking_stabilize.c
481                                             intern/tracking_util.c
482                                             PROPERTIES COMPILE_FLAGS -Werror)
483         endif()
484 endif()
485
486 if(WITH_FFTW3)
487         list(APPEND INC_SYS
488                 ${FFTW3_INCLUDE_DIRS}
489         )
490         add_definitions(-DFFTW3=1)
491 endif()
492
493 if(WITH_INTERNATIONAL)
494         add_definitions(-DWITH_INTERNATIONAL)
495 endif()
496
497 if(WITH_FREESTYLE)
498         add_definitions(-DWITH_FREESTYLE)
499 endif()
500
501 if(WITH_OPENSUBDIV)
502         add_definitions(-DWITH_OPENSUBDIV)
503         list(APPEND INC_SYS
504                 ../../../intern/opensubdiv
505                 ${OPENSUBDIV_INCLUDE_DIRS}
506         )
507 endif()
508
509 ## Warnings as errors, this is too strict!
510 #if(MSVC)
511 #       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
512 #endif()
513
514 if(WITH_LEGACY_DEPSGRAPH)
515         add_definitions(-DWITH_LEGACY_DEPSGRAPH)
516 endif()
517
518 blender_add_lib(bf_blenkernel "${SRC}" "${INC}" "${INC_SYS}")