CMakeLists.txt 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # OSL node shaders
  2. set(SRC_OSL
  3. node_add_closure.osl
  4. node_ambient_occlusion.osl
  5. node_anisotropic_bsdf.osl
  6. node_attribute.osl
  7. node_background.osl
  8. node_bevel.osl
  9. node_brick_texture.osl
  10. node_brightness.osl
  11. node_bump.osl
  12. node_camera.osl
  13. node_checker_texture.osl
  14. node_combine_rgb.osl
  15. node_combine_hsv.osl
  16. node_combine_xyz.osl
  17. node_convert_from_color.osl
  18. node_convert_from_float.osl
  19. node_convert_from_int.osl
  20. node_convert_from_normal.osl
  21. node_convert_from_point.osl
  22. node_convert_from_vector.osl
  23. node_diffuse_bsdf.osl
  24. node_displacement.osl
  25. node_vector_displacement.osl
  26. node_emission.osl
  27. node_environment_texture.osl
  28. node_fresnel.osl
  29. node_gamma.osl
  30. node_geometry.osl
  31. node_glass_bsdf.osl
  32. node_glossy_bsdf.osl
  33. node_gradient_texture.osl
  34. node_hair_info.osl
  35. node_scatter_volume.osl
  36. node_absorption_volume.osl
  37. node_principled_volume.osl
  38. node_holdout.osl
  39. node_hsv.osl
  40. node_ies_light.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_principled_hair_bsdf.osl
  87. node_uv_map.osl
  88. node_principled_bsdf.osl
  89. node_rgb_to_bw.osl
  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. set(SRC_OSO
  100. )
  101. # TODO, add a module to compile OSL
  102. foreach(_file ${SRC_OSL})
  103. set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
  104. set_source_files_properties(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
  105. string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE})
  106. string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
  107. add_custom_command(
  108. OUTPUT ${_OSO_FILE}
  109. COMMAND ${OSL_COMPILER} -q -O2 -I"${CMAKE_CURRENT_SOURCE_DIR}" -o ${_OSO_FILE} ${_OSL_FILE}
  110. DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS} ${OSL_COMPILER})
  111. list(APPEND SRC_OSO
  112. ${_OSO_FILE}
  113. )
  114. unset(_OSL_FILE)
  115. unset(_OSO_FILE)
  116. endforeach()
  117. add_custom_target(cycles_osl_shaders ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS} ${OSL_COMPILER} SOURCES ${SRC_OSL})
  118. cycles_set_solution_folder(cycles_osl_shaders)
  119. # CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths
  120. delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)
  121. delayed_install("${CMAKE_CURRENT_SOURCE_DIR}" "${SRC_OSL_HEADERS}" ${CYCLES_INSTALL_PATH}/shader)