Cycles:
[blender.git] / intern / cycles / kernel / shaders / CMakeLists.txt
1
2 # OSL node shaders
3
4 set(SRC_OSL
5         node_add_closure.osl
6         node_ambient_occlusion.osl
7         node_attribute.osl
8         node_background.osl
9         node_brick_texture.osl
10         node_brightness.osl
11         node_bump.osl
12         node_camera.osl
13         node_checker_texture.osl
14         node_combine_rgb.osl
15         node_combine_hsv.osl
16         node_convert_from_color.osl
17         node_convert_from_float.osl
18         node_convert_from_int.osl
19         node_convert_from_normal.osl
20         node_convert_from_point.osl
21         node_convert_from_vector.osl
22         node_diffuse_bsdf.osl
23         node_emission.osl
24         node_environment_texture.osl
25         node_fresnel.osl
26         node_gamma.osl
27         node_geometry.osl
28         node_glass_bsdf.osl
29         node_glossy_bsdf.osl
30         node_gradient_texture.osl
31         node_hair_info.osl
32         node_holdout.osl
33         node_hsv.osl
34         node_image_texture.osl
35         node_invert.osl
36         node_layer_weight.osl
37         node_light_falloff.osl
38         node_light_path.osl
39         node_magic_texture.osl
40         node_mapping.osl
41         node_math.osl
42         node_mix.osl
43         node_mix_closure.osl
44         node_musgrave_texture.osl
45         node_noise_texture.osl
46         node_normal.osl
47         node_normal_map.osl
48         node_object_info.osl
49         node_output_displacement.osl
50         node_output_surface.osl
51         node_output_volume.osl
52         node_particle_info.osl
53         node_refraction_bsdf.osl
54         node_rgb_curves.osl
55         node_rgb_ramp.osl
56         node_separate_rgb.osl
57         node_separate_hsv.osl
58         node_set_normal.osl
59         node_sky_texture.osl
60         node_subsurface_scattering.osl
61         node_tangent.osl
62         node_texture_coordinate.osl
63         node_toon_bsdf.osl
64         node_translucent_bsdf.osl
65         node_transparent_bsdf.osl
66         node_value.osl
67         node_vector_curves.osl
68         node_vector_math.osl
69         node_vector_transform.osl
70         node_velvet_bsdf.osl
71         node_voronoi_texture.osl
72         node_ward_bsdf.osl
73         node_wavelength.osl
74         node_blackbody.osl
75         node_wave_texture.osl
76         node_wireframe.osl
77 )
78
79 set(SRC_OSL_HEADERS
80         node_texture.h
81         node_color.h
82         node_fresnel.h
83         stdosl.h
84         oslutil.h
85 )
86
87 set(SRC_OSO
88
89 )
90
91 # TODO, add a module to compile OSL
92 foreach(_file ${SRC_OSL})
93         set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
94         string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE})
95         string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
96         add_custom_command(
97                 OUTPUT ${_OSO_FILE} 
98                 COMMAND ${OSL_COMPILER} -q -O2  -I"${CMAKE_CURRENT_SOURCE_DIR}" ${_OSL_FILE}
99                 DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS})
100         list(APPEND SRC_OSO
101                 ${_OSO_FILE}
102         )
103
104         unset(_OSL_FILE)
105         unset(_OSO_FILE)
106 endforeach()
107
108 add_custom_target(cycles_osl_shaders ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS})
109
110 # CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths
111 delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)
112 delayed_install("${CMAKE_CURRENT_SOURCE_DIR}" "${SRC_OSL_HEADERS}" ${CYCLES_INSTALL_PATH}/shader)
113