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