msvc: Use source folder structure for project file.
[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_holdout.osl
40         node_hsv.osl
41         node_image_texture.osl
42         node_invert.osl
43         node_layer_weight.osl
44         node_light_falloff.osl
45         node_light_path.osl
46         node_magic_texture.osl
47         node_mapping.osl
48         node_math.osl
49         node_mix.osl
50         node_mix_closure.osl
51         node_musgrave_texture.osl
52         node_noise_texture.osl
53         node_normal.osl
54         node_normal_map.osl
55         node_object_info.osl
56         node_output_displacement.osl
57         node_output_surface.osl
58         node_output_volume.osl
59         node_particle_info.osl
60         node_refraction_bsdf.osl
61         node_rgb_curves.osl
62         node_rgb_ramp.osl
63         node_separate_rgb.osl
64         node_separate_hsv.osl
65         node_separate_xyz.osl
66         node_set_normal.osl
67         node_sky_texture.osl
68         node_subsurface_scattering.osl
69         node_tangent.osl
70         node_texture_coordinate.osl
71         node_toon_bsdf.osl
72         node_translucent_bsdf.osl
73         node_transparent_bsdf.osl
74         node_value.osl
75         node_vector_curves.osl
76         node_vector_math.osl
77         node_vector_transform.osl
78         node_velvet_bsdf.osl
79         node_voronoi_texture.osl
80         node_voxel_texture.osl
81         node_wavelength.osl
82         node_blackbody.osl
83         node_wave_texture.osl
84         node_wireframe.osl
85         node_hair_bsdf.osl
86         node_uv_map.osl
87         node_principled_bsdf.osl
88         node_rgb_to_bw.osl
89 )
90
91 set(SRC_OSL_HEADERS
92         node_color.h
93         node_fresnel.h
94         node_ramp_util.h
95         node_texture.h
96         stdosl.h
97         oslutil.h
98 )
99
100 set(SRC_OSO
101
102 )
103
104 # TODO, add a module to compile OSL
105 foreach(_file ${SRC_OSL})
106         set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
107         set_source_files_properties(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
108         string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE})
109         string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
110         add_custom_command(
111                 OUTPUT ${_OSO_FILE} 
112                 COMMAND ${OSL_COMPILER} -q -O2  -I"${CMAKE_CURRENT_SOURCE_DIR}" -o ${_OSO_FILE} ${_OSL_FILE}
113                 DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS} ${OSL_COMPILER})
114         list(APPEND SRC_OSO
115                 ${_OSO_FILE}
116         )
117
118         unset(_OSL_FILE)
119         unset(_OSO_FILE)
120 endforeach()
121
122 add_custom_target(cycles_osl_shaders ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS} ${OSL_COMPILER} SOURCES ${SRC_OSL})
123 cycles_set_solution_folder(cycles_osl_shaders)
124
125 # CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths
126 delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)
127 delayed_install("${CMAKE_CURRENT_SOURCE_DIR}" "${SRC_OSL_HEADERS}" ${CYCLES_INSTALL_PATH}/shader)
128