* Forgot to commit CMake change for the Brick texture.
[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_output_displacement.osl
42         node_output_surface.osl
43         node_output_volume.osl
44         node_separate_rgb.osl
45         node_sky_texture.osl
46         node_texture_coordinate.osl
47         node_translucent_bsdf.osl
48         node_transparent_bsdf.osl
49         node_value.osl
50         node_vector_math.osl
51         node_velvet_bsdf.osl
52         node_voronoi_texture.osl
53         node_ward_bsdf.osl
54         node_wave_texture.osl
55 )
56
57 set(SRC_OSL_HEADERS
58         node_texture.h
59         node_color.h
60         node_fresnel.h
61         stdosl.h
62         oslutil.h
63 )
64
65 set(SRC_OSO
66
67 )
68
69 # TODO, add a module to compile OSL
70 foreach(_file ${SRC_OSL})
71         set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
72         string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE})  # TODO, replace extension only
73         string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
74         add_custom_command(
75                 OUTPUT ${_OSO_FILE} 
76                 COMMAND ${OSL_COMPILER} -O2 ${_OSL_FILE}
77                 DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS})
78         list(APPEND SRC_OSO
79                 ${_OSO_FILE}
80         )
81         
82         unset(_OSL_FILE)
83         unset(_OSO_FILE)
84 endforeach()
85
86 add_custom_target(shader ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS})
87
88 # CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths
89 delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)