diff options
author | Ray Molenkamp <github@lazydodo.com> | 2020-02-17 20:28:12 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2020-02-17 20:28:12 +0300 |
commit | 8d60e6fa387891dd3879183b502e636e1e86b594 (patch) | |
tree | 3f321f08b2b944e12a29c92a29561acd4c1f8e59 /build_files/cmake/Modules | |
parent | a33b261473e95de8d8d438dbb6aa7afe513fb082 (diff) |
Fix: T73830 OSL not finding stdosl.h on linux
This extends FindOpenShadingLanguage.cmake to also look for the location of
stdosl.h and adds the path to the invocation of oslc to deal with the headers
being in different locations a little better.
Differential Revision: https://developer.blender.org/D6865
Reviewers: brecht
Diffstat (limited to 'build_files/cmake/Modules')
-rw-r--r-- | build_files/cmake/Modules/FindOpenShadingLanguage.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/build_files/cmake/Modules/FindOpenShadingLanguage.cmake b/build_files/cmake/Modules/FindOpenShadingLanguage.cmake index 01ed72051f7..07ed2c86e19 100644 --- a/build_files/cmake/Modules/FindOpenShadingLanguage.cmake +++ b/build_files/cmake/Modules/FindOpenShadingLanguage.cmake @@ -66,6 +66,22 @@ FIND_PROGRAM(OSL_COMPILER oslc HINTS ${_osl_SEARCH_DIRS} PATH_SUFFIXES bin) +get_filename_component(OSL_SHADER_HINT ${OSL_COMPILER} DIRECTORY) +get_filename_component(OSL_SHADER_HINT ${OSL_SHADER_DIR}/../ ABSOLUTE) + +FIND_PATH(OSL_SHADER_DIR + NAMES + stdosl.h + HINTS + ${OSL_ROOT_DIR} + ${OSL_SHADER_HINT} + $ENV{OSLHOME} + /usr/share/OSL/ + /usr/include/OSL/ + PATH_SUFFIXES + shaders +) + # handle the QUIETLY and REQUIRED arguments and set OSL_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) |