diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bb5d8af627..c6d8d8d2a87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -672,6 +672,31 @@ if(UNIX AND NOT APPLE) endif() endif() + if(WITH_CYCLES_OSL) + set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation") + + message(STATUS "CYCLES_OSL = ${CYCLES_OSL}") + + find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib ${CYCLES_OSL}/dist) + find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib ${CYCLES_OSL}/dist) + find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib ${CYCLES_OSL}/dist) + # WARNING! depends on correct order of OSL libs linking + list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} ${OSL_LIB_EXEC} ${OSL_LIB_QUERY}) + find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include ${CYCLES_OSL}/dist) + find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin ${CYCLES_OSL}/dist) + + if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER) + set(OSL_FOUND TRUE) + message(STATUS "OSL includes = ${OSL_INCLUDES}") + message(STATUS "OSL library = ${OSL_LIBRARIES}") + message(STATUS "OSL compiler = ${OSL_COMPILER}") + else() + message(STATUS "OSL not found") + endif() + + include_directories(${OSL_INCLUDES} ${OSL_INCLUDES}/OSL ${OSL_INCLUDES}/../../../src/liboslexec) + endif() + # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++") |