Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-09-10 10:18:20 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-09-10 10:18:20 +0400
commit1352a955ca61b20d071d064d88f981711f80dd1d (patch)
tree1ef07c261158eb4cf9064ff6d6bf19a7b5115305 /CMakeLists.txt
parent12c71a8c6866e345373127e976f55cb15aa73ded (diff)
Cleanup for OSL linking in cmake: Move cmake OSL library search and path definition from the cycles macro file to the top-level CMakeLists.txt. This makes the OSL_LIBRARIES and other variables accessible throughout Blender cmake scripts and especially in the creator module for linking libraries.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
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++")