Cleanup: use doxy groups
[blender.git] / intern / opensubdiv / 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) 2013, Blender Foundation
18 # All rights reserved.
19 # ***** END GPL LICENSE BLOCK *****
20
21 set(INC
22   .
23   ../guardedalloc
24 )
25
26 set(INC_SYS
27 )
28
29 set(SRC
30   opensubdiv_capi.h
31   opensubdiv_capi_type.h
32   opensubdiv_converter_capi.h
33   opensubdiv_evaluator_capi.h
34   opensubdiv_gl_mesh_capi.h
35   opensubdiv_topology_refiner_capi.h
36 )
37
38 set(LIB
39 )
40
41 if(WITH_OPENSUBDIV)
42   macro(OPENSUBDIV_DEFINE_COMPONENT component)
43     if(${${component}})
44       add_definitions(-D${component})
45     endif()
46   endmacro()
47
48   list(APPEND INC_SYS
49     ${OPENSUBDIV_INCLUDE_DIR}
50     ${GLEW_INCLUDE_PATH}
51   )
52
53   list(APPEND SRC
54     internal/opensubdiv.cc
55     internal/opensubdiv_converter_factory.cc
56     internal/opensubdiv_converter_internal.cc
57     internal/opensubdiv_converter_orient.cc
58     internal/opensubdiv_device_context_cuda.cc
59     internal/opensubdiv_device_context_opencl.cc
60     internal/opensubdiv_evaluator.cc
61     internal/opensubdiv_evaluator_internal.cc
62     internal/opensubdiv_gl_mesh.cc
63     internal/opensubdiv_gl_mesh_draw.cc
64     internal/opensubdiv_gl_mesh_fvar.cc
65     internal/opensubdiv_gl_mesh_internal.cc
66     internal/opensubdiv_topology_refiner.cc
67     internal/opensubdiv_topology_refiner_internal.cc
68     internal/opensubdiv_util.cc
69
70     internal/opensubdiv_converter_factory.h
71     internal/opensubdiv_converter_internal.h
72     internal/opensubdiv_converter_orient.h
73     internal/opensubdiv_converter_orient_impl.h
74     internal/opensubdiv_device_context_cuda.h
75     internal/opensubdiv_device_context_opencl.h
76     internal/opensubdiv_edge_map.h
77     internal/opensubdiv_evaluator_internal.h
78     internal/opensubdiv_gl_mesh_draw.h
79     internal/opensubdiv_gl_mesh_fvar.h
80     internal/opensubdiv_gl_mesh_internal.h
81     internal/opensubdiv_internal.h
82     internal/opensubdiv_topology_refiner_internal.h
83     internal/opensubdiv_util.h
84   )
85
86   OPENSUBDIV_DEFINE_COMPONENT(OPENSUBDIV_HAS_OPENMP)
87   # TODO(sergey): OpenCL is not tested and totally unstable atm.
88   # OPENSUBDIV_DEFINE_COMPONENT(OPENSUBDIV_HAS_OPENCL)
89   # TODO(sergey): CUDA stays disabled for util it's ported to drievr API.
90   # OPENSUBDIV_DEFINE_COMPONENT(OPENSUBDIV_HAS_CUDA)
91   OPENSUBDIV_DEFINE_COMPONENT(OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK)
92   OPENSUBDIV_DEFINE_COMPONENT(OPENSUBDIV_HAS_GLSL_COMPUTE)
93
94   data_to_c_simple(shader/gpu_shader_opensubdiv_vertex.glsl SRC)
95   data_to_c_simple(shader/gpu_shader_opensubdiv_geometry.glsl SRC)
96   data_to_c_simple(shader/gpu_shader_opensubdiv_fragment.glsl SRC)
97
98   add_definitions(-DGLEW_STATIC)
99
100   if(WIN32)
101     add_definitions(-DNOMINMAX)
102     add_definitions(-D_USE_MATH_DEFINES)
103   endif()
104
105   # TODO(sergey): Put CUEW back when CUDA is officially supported by OSD.
106   #if(OPENSUBDIV_HAS_CUDA)
107   #   list(APPEND INC
108   #       ../../extern/cuew/include
109   #   )
110   #   add_definitions(-DOPENSUBDIV_HAS_CUEW)
111   #endif()
112
113   if(OPENSUBDIV_HAS_OPENCL)
114     list(APPEND INC
115       ../../extern/clew/include
116     )
117     add_definitions(-DOPENSUBDIV_HAS_CLEW)
118   endif()
119 else()
120   list(APPEND SRC
121     stub/opensubdiv_stub.cc
122     stub/opensubdiv_evaluator_stub.cc
123     stub/opensubdiv_gl_mesh_stub.cc
124     stub/opensubdiv_topology_refiner_stub.cc
125   )
126 endif()
127
128 blender_add_lib(bf_intern_opensubdiv "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")