Cleanup: trailing space in CMake files
[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_anisotropic_bsdf.osl
8         node_attribute.osl
9         node_background.osl
10         node_bevel.osl
11         node_brick_texture.osl
12         node_brightness.osl
13         node_bump.osl
14         node_camera.osl
15         node_checker_texture.osl
16         node_combine_rgb.osl
17         node_combine_hsv.osl
18         node_combine_xyz.osl
19         node_convert_from_color.osl
20         node_convert_from_float.osl
21         node_convert_from_int.osl
22         node_convert_from_normal.osl
23         node_convert_from_point.osl
24         node_convert_from_vector.osl
25         node_diffuse_bsdf.osl
26         node_displacement.osl
27         node_vector_displacement.osl
28         node_emission.osl
29         node_environment_texture.osl
30         node_fresnel.osl
31         node_gamma.osl
32         node_geometry.osl
33         node_glass_bsdf.osl
34         node_glossy_bsdf.osl
35         node_gradient_texture.osl
36         node_hair_info.osl
37         node_scatter_volume.osl
38         node_absorption_volume.osl
39         node_principled_volume.osl
40         node_holdout.osl
41         node_hsv.osl
42         node_ies_light.osl
43         node_image_texture.osl
44         node_invert.osl
45         node_layer_weight.osl
46         node_light_falloff.osl
47         node_light_path.osl
48         node_magic_texture.osl
49         node_mapping.osl
50         node_math.osl
51         node_mix.osl
52         node_mix_closure.osl
53         node_musgrave_texture.osl
54         node_noise_texture.osl
55         node_normal.osl
56         node_normal_map.osl
57         node_object_info.osl
58         node_output_displacement.osl
59         node_output_surface.osl
60         node_output_volume.osl
61         node_particle_info.osl
62         node_refraction_bsdf.osl
63         node_rgb_curves.osl
64         node_rgb_ramp.osl
65         node_separate_rgb.osl
66         node_separate_hsv.osl
67         node_separate_xyz.osl
68         node_set_normal.osl
69         node_sky_texture.osl
70         node_subsurface_scattering.osl
71         node_tangent.osl
72         node_texture_coordinate.osl
73         node_toon_bsdf.osl
74         node_translucent_bsdf.osl
75         node_transparent_bsdf.osl
76         node_value.osl
77         node_vector_curves.osl
78         node_vector_math.osl
79         node_vector_transform.osl
80         node_velvet_bsdf.osl
81         node_voronoi_texture.osl
82         node_voxel_texture.osl
83         node_wavelength.osl
84         node_blackbody.osl
85         node_wave_texture.osl
86         node_wireframe.osl
87         node_hair_bsdf.osl
88         node_uv_map.osl
89         node_principled_bsdf.osl
90         node_rgb_to_bw.osl
91 )
92
93 set(SRC_OSL_HEADERS
94         node_color.h
95         node_fresnel.h
96         node_ramp_util.h
97         node_texture.h
98         stdosl.h
99         oslutil.h
100 )
101
102 set(SRC_OSO
103
104 )
105
106 # TODO, add a module to compile OSL
107 foreach(_file ${SRC_OSL})
108         set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
109         set_source_files_properties(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
110         string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE})
111         string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
112         add_custom_command(
113                 OUTPUT ${_OSO_FILE}
114                 COMMAND ${OSL_COMPILER} -q -O2  -I"${CMAKE_CURRENT_SOURCE_DIR}" -o ${_OSO_FILE} ${_OSL_FILE}
115                 DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS} ${OSL_COMPILER})
116         list(APPEND SRC_OSO
117                 ${_OSO_FILE}
118         )
119
120         unset(_OSL_FILE)
121         unset(_OSO_FILE)
122 endforeach()
123
124 add_custom_target(cycles_osl_shaders ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS} ${OSL_COMPILER} SOURCES ${SRC_OSL})
125 cycles_set_solution_folder(cycles_osl_shaders)
126
127 # CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths
128 delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)
129 delayed_install("${CMAKE_CURRENT_SOURCE_DIR}" "${SRC_OSL_HEADERS}" ${CYCLES_INSTALL_PATH}/shader)
130