This option limits visibility of the glew.h header to just bf_gpu and intern_gawain
[blender.git] / source / blender / gpu / 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 # WITH_OPENGL limits the visibility of the opengl headers to just gawain and bg_gpu,
27 # to more easily highlight codepadths in other libraries that need to be refactored, 
28 # bf_gpu is allowed to have opengl regardless of this option.
29
30 if(NOT WITH_OPENGL)
31         add_definitions(-DWITH_OPENGL)
32 endif()
33
34 set(INC
35         .
36         ../blenkernel
37         ../blenlib
38         ../bmesh
39         ../imbuf
40         ../makesdna
41         ../makesrna
42         ../draw
43
44         ../editors/include
45
46         # For node muting stuff...
47         ../nodes
48         ../nodes/intern
49
50         ../../../intern/glew-mx
51         ../../../intern/guardedalloc
52         ../../../intern/smoke/extern
53         ../../../intern/gawain
54 )
55
56 set(INC_SYS
57         ${GLEW_INCLUDE_PATH}
58 )
59
60 set(SRC
61         intern/gpu_basic_shader.c
62         intern/gpu_batch.c
63         intern/gpu_batch_presets.c
64         intern/gpu_buffers.c
65         intern/gpu_codegen.c
66         intern/gpu_debug.c
67         intern/gpu_draw.c
68         intern/gpu_extensions.c
69         intern/gpu_framebuffer.c
70         intern/gpu_immediate.c
71         intern/gpu_immediate_util.c
72         intern/gpu_init_exit.c
73         intern/gpu_material.c
74         intern/gpu_matrix.c
75         intern/gpu_select.c
76         intern/gpu_select_pick.c
77         intern/gpu_select_sample_query.c
78         intern/gpu_shader.c
79         intern/gpu_texture.c
80         intern/gpu_uniformbuffer.c
81         intern/gpu_viewport.c
82
83         shaders/gpu_shader_fx_lib.glsl
84         shaders/gpu_shader_fx_ssao_frag.glsl
85         shaders/gpu_shader_fx_dof_frag.glsl
86         shaders/gpu_shader_fx_dof_vert.glsl
87         shaders/gpu_shader_fx_dof_hq_frag.glsl
88         shaders/gpu_shader_fx_dof_hq_vert.glsl
89         shaders/gpu_shader_fx_dof_hq_geo.glsl
90         shaders/gpu_shader_material.glsl
91         shaders/gpu_shader_sep_gaussian_blur_frag.glsl
92         shaders/gpu_shader_sep_gaussian_blur_vert.glsl
93         shaders/gpu_shader_basic_frag.glsl
94         shaders/gpu_shader_basic_vert.glsl
95         shaders/gpu_shader_basic_geom.glsl
96         shaders/gpu_shader_vertex.glsl
97         shaders/gpu_shader_vsm_store_frag.glsl
98         shaders/gpu_shader_vsm_store_vert.glsl
99         shaders/gpu_shader_fx_depth_resolve.glsl
100         shaders/gpu_shader_fire_frag.glsl
101         shaders/gpu_shader_smoke_frag.glsl
102         shaders/gpu_shader_smoke_vert.glsl
103
104         GPU_basic_shader.h
105         GPU_batch.h
106         GPU_buffers.h
107         GPU_debug.h
108         GPU_draw.h
109         GPU_extensions.h
110         GPU_framebuffer.h
111         GPU_glew.h
112         GPU_immediate.h
113         GPU_immediate_util.h
114         GPU_init_exit.h
115         GPU_legacy_stubs.h
116         GPU_material.h
117         GPU_matrix.h
118         GPU_select.h
119         GPU_shader.h
120         GPU_texture.h
121         GPU_uniformbuffer.h
122         GPU_viewport.h
123
124         intern/gpu_codegen.h
125         intern/gpu_private.h
126         intern/gpu_select_private.h
127         intern/gpu_shader_private.h
128 )
129
130 data_to_c_simple(shaders/gpu_shader_depth_only_frag.glsl SRC)
131 data_to_c_simple(shaders/gpu_shader_uniform_color_frag.glsl SRC)
132 data_to_c_simple(shaders/gpu_shader_checker_frag.glsl SRC)
133 data_to_c_simple(shaders/gpu_shader_diag_stripes_frag.glsl SRC)
134 data_to_c_simple(shaders/gpu_shader_simple_lighting_frag.glsl SRC)
135 data_to_c_simple(shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl SRC)
136 data_to_c_simple(shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl SRC)
137 data_to_c_simple(shaders/gpu_shader_flat_color_frag.glsl SRC)
138 data_to_c_simple(shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl SRC)
139 data_to_c_simple(shaders/gpu_shader_flat_id_frag.glsl SRC)
140 data_to_c_simple(shaders/gpu_shader_2D_vert.glsl SRC)
141 data_to_c_simple(shaders/gpu_shader_2D_widget_base_vert.glsl SRC)
142 data_to_c_simple(shaders/gpu_shader_2D_widget_base_frag.glsl SRC)
143 data_to_c_simple(shaders/gpu_shader_2D_widget_shadow_vert.glsl SRC)
144 data_to_c_simple(shaders/gpu_shader_2D_widget_shadow_frag.glsl SRC)
145 data_to_c_simple(shaders/gpu_shader_2D_nodelink_frag.glsl SRC)
146 data_to_c_simple(shaders/gpu_shader_2D_nodelink_vert.glsl SRC)
147 data_to_c_simple(shaders/gpu_shader_2D_flat_color_vert.glsl SRC)
148 data_to_c_simple(shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl SRC)
149 data_to_c_simple(shaders/gpu_shader_2D_line_dashed_frag.glsl SRC)
150 data_to_c_simple(shaders/gpu_shader_2D_line_dashed_geom.glsl SRC)
151 data_to_c_simple(shaders/gpu_shader_2D_smooth_color_vert.glsl SRC)
152 data_to_c_simple(shaders/gpu_shader_2D_smooth_color_frag.glsl SRC)
153 data_to_c_simple(shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl SRC)
154 data_to_c_simple(shaders/gpu_shader_2D_image_vert.glsl SRC)
155 data_to_c_simple(shaders/gpu_shader_2D_image_rect_vert.glsl SRC)
156 data_to_c_simple(shaders/gpu_shader_2D_image_multi_rect_vert.glsl SRC)
157 data_to_c_simple(shaders/gpu_shader_image_frag.glsl SRC)
158 data_to_c_simple(shaders/gpu_shader_image_desaturate_frag.glsl SRC)
159 data_to_c_simple(shaders/gpu_shader_image_linear_frag.glsl SRC)
160 data_to_c_simple(shaders/gpu_shader_image_shuffle_color_frag.glsl SRC)
161 data_to_c_simple(shaders/gpu_shader_image_mask_uniform_color_frag.glsl SRC)
162 data_to_c_simple(shaders/gpu_shader_image_modulate_alpha_frag.glsl SRC)
163 data_to_c_simple(shaders/gpu_shader_image_alpha_color_frag.glsl SRC)
164 data_to_c_simple(shaders/gpu_shader_image_color_frag.glsl SRC)
165 data_to_c_simple(shaders/gpu_shader_image_varying_color_frag.glsl SRC)
166 data_to_c_simple(shaders/gpu_shader_image_depth_linear_frag.glsl SRC)
167 data_to_c_simple(shaders/gpu_shader_image_depth_copy_frag.glsl SRC)
168 data_to_c_simple(shaders/gpu_shader_image_interlace_frag.glsl SRC)
169 data_to_c_simple(shaders/gpu_shader_image_multisample_resolve_frag.glsl SRC)
170 data_to_c_simple(shaders/gpu_shader_3D_image_vert.glsl SRC)
171 data_to_c_simple(shaders/gpu_shader_3D_vert.glsl SRC)
172 data_to_c_simple(shaders/gpu_shader_3D_normal_vert.glsl SRC)
173 data_to_c_simple(shaders/gpu_shader_3D_flat_color_vert.glsl SRC)
174 data_to_c_simple(shaders/gpu_shader_3D_line_dashed_uniform_color_legacy_vert.glsl SRC)
175 data_to_c_simple(shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl SRC)
176 data_to_c_simple(shaders/gpu_shader_3D_smooth_color_vert.glsl SRC)
177 data_to_c_simple(shaders/gpu_shader_3D_normal_smooth_color_vert.glsl SRC)
178 data_to_c_simple(shaders/gpu_shader_3D_smooth_color_frag.glsl SRC)
179 data_to_c_simple(shaders/gpu_shader_3D_passthrough_vert.glsl SRC)
180 data_to_c_simple(shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl SRC)
181
182 data_to_c_simple(shaders/gpu_shader_instance_vert.glsl SRC)
183 data_to_c_simple(shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl SRC)
184 data_to_c_simple(shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl SRC)
185 data_to_c_simple(shaders/gpu_shader_instance_objectspace_variying_color_vert.glsl SRC)
186 data_to_c_simple(shaders/gpu_shader_instance_screenspace_variying_color_vert.glsl SRC)
187 data_to_c_simple(shaders/gpu_shader_instance_screen_aligned_vert.glsl SRC)
188 data_to_c_simple(shaders/gpu_shader_instance_camera_vert.glsl SRC)
189 data_to_c_simple(shaders/gpu_shader_instance_distance_line_vert.glsl SRC)
190 data_to_c_simple(shaders/gpu_shader_instance_edges_variying_color_geom.glsl SRC)
191 data_to_c_simple(shaders/gpu_shader_instance_edges_variying_color_vert.glsl SRC)
192
193 data_to_c_simple(shaders/gpu_shader_3D_groundline_geom.glsl SRC)
194 data_to_c_simple(shaders/gpu_shader_3D_groundpoint_vert.glsl SRC)
195
196 data_to_c_simple(shaders/gpu_shader_point_uniform_color_frag.glsl SRC)
197 data_to_c_simple(shaders/gpu_shader_point_uniform_color_aa_frag.glsl SRC)
198 data_to_c_simple(shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl SRC)
199 data_to_c_simple(shaders/gpu_shader_point_varying_color_outline_aa_frag.glsl SRC)
200 data_to_c_simple(shaders/gpu_shader_point_varying_color_frag.glsl SRC)
201 data_to_c_simple(shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl SRC)
202 data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_vert.glsl SRC)
203 data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl SRC)
204 data_to_c_simple(shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl SRC)
205 data_to_c_simple(shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl SRC)
206 data_to_c_simple(shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl SRC)
207 data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl SRC)
208 data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl SRC)
209 data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert.glsl SRC)
210
211 data_to_c_simple(shaders/gpu_shader_edges_front_back_persp_vert.glsl SRC)
212 data_to_c_simple(shaders/gpu_shader_edges_front_back_persp_geom.glsl SRC)
213 data_to_c_simple(shaders/gpu_shader_edges_front_back_persp_legacy_vert.glsl SRC)
214 data_to_c_simple(shaders/gpu_shader_edges_front_back_ortho_vert.glsl SRC)
215 data_to_c_simple(shaders/gpu_shader_edges_overlay_vert.glsl SRC)
216 data_to_c_simple(shaders/gpu_shader_edges_overlay_geom.glsl SRC)
217 data_to_c_simple(shaders/gpu_shader_edges_overlay_simple_geom.glsl SRC)
218 data_to_c_simple(shaders/gpu_shader_edges_overlay_frag.glsl SRC)
219 data_to_c_simple(shaders/gpu_shader_text_simple_vert.glsl SRC)
220 data_to_c_simple(shaders/gpu_shader_text_simple_geom.glsl SRC)
221 data_to_c_simple(shaders/gpu_shader_text_vert.glsl SRC)
222 data_to_c_simple(shaders/gpu_shader_text_geom.glsl SRC)
223 data_to_c_simple(shaders/gpu_shader_text_frag.glsl SRC)
224 data_to_c_simple(shaders/gpu_shader_keyframe_diamond_vert.glsl SRC)
225 data_to_c_simple(shaders/gpu_shader_keyframe_diamond_frag.glsl SRC)
226
227 data_to_c_simple(shaders/gpu_shader_geometry.glsl SRC)
228 data_to_c_simple(shaders/gpu_shader_fire_frag.glsl SRC)
229 data_to_c_simple(shaders/gpu_shader_smoke_frag.glsl SRC)
230 data_to_c_simple(shaders/gpu_shader_smoke_vert.glsl SRC)
231 data_to_c_simple(shaders/gpu_shader_material.glsl SRC)
232 data_to_c_simple(shaders/gpu_shader_sep_gaussian_blur_frag.glsl SRC)
233 data_to_c_simple(shaders/gpu_shader_sep_gaussian_blur_vert.glsl SRC)
234 data_to_c_simple(shaders/gpu_shader_basic_frag.glsl SRC)
235 data_to_c_simple(shaders/gpu_shader_basic_vert.glsl SRC)
236 data_to_c_simple(shaders/gpu_shader_basic_geom.glsl SRC)
237 data_to_c_simple(shaders/gpu_shader_vertex.glsl SRC)
238 data_to_c_simple(shaders/gpu_shader_vertex_world.glsl SRC)
239 data_to_c_simple(shaders/gpu_shader_vsm_store_frag.glsl SRC)
240 data_to_c_simple(shaders/gpu_shader_vsm_store_vert.glsl SRC)
241
242 if(WITH_MOD_SMOKE)
243         add_definitions(-DWITH_SMOKE)
244 endif()
245
246 add_definitions(${GL_DEFINITIONS})
247
248 if(WITH_IMAGE_DDS)
249         add_definitions(-DWITH_DDS)
250 endif()
251
252 if(WITH_OPENSUBDIV)
253         add_definitions(-DWITH_OPENSUBDIV)
254 endif()
255
256 blender_add_lib(bf_gpu "${SRC}" "${INC}" "${INC_SYS}")
257