Cycles: svn merge -r41225:41232 ^/trunk/blender
[blender.git] / intern / cycles / kernel / osl / nodes / CMakeLists.txt
1
2 # OSL node shaders
3
4 set(osl_sources
5         node_add_closure.osl
6         node_attribute.osl
7         node_background.osl
8         node_blend_texture.osl
9         node_bump.osl
10         node_clouds_texture.osl
11         node_convert_from_color.osl
12         node_convert_from_float.osl
13         node_convert_from_normal.osl
14         node_convert_from_point.osl
15         node_convert_from_vector.osl
16         node_diffuse_bsdf.osl
17         node_distorted_noise_texture.osl
18         node_emission.osl
19         node_environment_texture.osl
20         node_fresnel.osl
21         node_geometry.osl
22         node_glass_bsdf.osl
23         node_glossy_bsdf.osl
24         node_image_texture.osl
25         node_light_path.osl
26         node_magic_texture.osl
27         node_mapping.osl
28         node_marble_texture.osl
29         node_math.osl
30         node_mix.osl
31         node_mix_closure.osl
32         node_musgrave_texture.osl
33         node_blend_weight_texture.osl
34         node_noise_texture.osl
35         node_output_displacement.osl
36         node_output_surface.osl
37         node_output_volume.osl
38         node_sky_texture.osl
39         node_stucci_texture.osl
40         node_texture_coordinate.osl
41         node_translucent_bsdf.osl
42         node_transparent_bsdf.osl
43         node_value.osl
44         node_vector_math.osl
45         node_velvet_bsdf.osl
46         node_voronoi_texture.osl
47         node_ward_bsdf.osl
48         node_wood_texture.osl)
49
50 set(osl_headers
51         node_texture.h
52         stdosl.h)
53
54 set(oso_sources)
55
56 foreach(_file ${osl_sources})
57         set(osl_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
58         string(REPLACE ".osl" ".oso" oso_file ${osl_file})
59         string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} oso_file ${oso_file})
60         add_custom_command(
61                 OUTPUT ${oso_file} 
62                 COMMAND ${OSL_COMPILER} -O2 ${osl_file}
63                 DEPENDS ${osl_file} ${osl_headers})
64         list(APPEND oso_sources ${oso_file})
65 endforeach()
66
67 add_custom_target(shader ALL DEPENDS ${oso_sources} ${osl_headers})
68
69 delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${oso_sources}" ${CYCLES_INSTALL_PATH}/shader)
70