Added Object Info node implementation for OSL. This uses an additional attribute...
[blender.git] / intern / cycles / kernel / osl / nodes / CMakeLists.txt
1
2 # OSL node shaders
3
4 set(SRC_OSL
5         node_add_closure.osl
6         node_attribute.osl
7         node_background.osl
8         node_brick_texture.osl
9         node_bump.osl
10         node_camera.osl
11         node_checker_texture.osl
12         node_combine_rgb.osl
13         node_convert_from_color.osl
14         node_convert_from_float.osl
15         node_convert_from_normal.osl
16         node_convert_from_point.osl
17         node_convert_from_vector.osl
18         node_diffuse_bsdf.osl
19         node_emission.osl
20         node_environment_texture.osl
21         node_fresnel.osl
22         node_gamma.osl
23         node_gradient_texture.osl
24         node_brightness.osl
25         node_geometry.osl
26         node_glass_bsdf.osl
27         node_glossy_bsdf.osl
28         node_holdout.osl
29         node_hsv.osl
30         node_image_texture.osl
31         node_invert.osl
32         node_light_path.osl
33         node_magic_texture.osl
34         node_mapping.osl
35         node_math.osl
36         node_mix.osl
37         node_mix_closure.osl
38         node_musgrave_texture.osl
39         node_normal.osl
40         node_noise_texture.osl
41         node_object_info.osl
42         node_output_displacement.osl
43         node_output_surface.osl
44         node_output_volume.osl
45         node_separate_rgb.osl
46         node_sky_texture.osl
47         node_texture_coordinate.osl
48         node_translucent_bsdf.osl
49         node_transparent_bsdf.osl
50         node_value.osl
51         node_vector_math.osl
52         node_velvet_bsdf.osl
53         node_voronoi_texture.osl
54         node_ward_bsdf.osl
55         node_wave_texture.osl
56 )
57
58 set(SRC_OSL_HEADERS
59         node_texture.h
60         node_color.h
61         node_fresnel.h
62         stdosl.h
63         oslutil.h
64 )
65
66 set(SRC_OSO
67
68 )
69
70 # TODO, add a module to compile OSL
71 foreach(_file ${SRC_OSL})
72         set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
73         string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE})  # TODO, replace extension only
74         string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
75         add_custom_command(
76                 OUTPUT ${_OSO_FILE} 
77                 COMMAND ${OSL_COMPILER} -O2 ${_OSL_FILE}
78                 DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS})
79         list(APPEND SRC_OSO
80                 ${_OSO_FILE}
81         )
82         
83         unset(_OSL_FILE)
84         unset(_OSO_FILE)
85 endforeach()
86
87 add_custom_target(shader ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS})
88
89 # CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths
90 delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)