diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-15 14:03:17 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-15 14:03:17 +0400 |
commit | b93da9b01e163158a830872d29f8bd874f63d54d (patch) | |
tree | 59730d1145eba4638a5128d0cc2c5fe3215007ab /CMakeLists.txt | |
parent | 8add19d3ece8526f5334acec90fd4c1f1155218c (diff) |
Color Management, Stage 1: Initial OpenColorIO library integration
This commit integrates support of OpenColorIO library into build systems.
It also contains C-API for OpenColorIO library which could be used by Blender.
CMake has got find rules familiar to OpenImageIO's one which makes it easier
for build system to find needed libraries and includes. Scons only could use
explicitly defined paths to libraries and includes.
C-API would be compiled and Blender would be linked against C-API and OpenColorIO
but it wouldn't affect on Blender behavior at all.
OpenColorIO could be disabled by setting up WITH_OCIO to Off in CMake and
setting WITH_BF_OCIO in Scons.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 07d08c79f9f..83e094b4375 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,7 @@ option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effect option(WITH_BULLET "Enable Bullet (Physics Engine)" ON) option(WITH_GAMEENGINE "Enable Game Engine" ON) option(WITH_PLAYER "Build Player" OFF) +option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON) option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON) option(WITH_COMPOSITOR_LEGACY "Enable legacy compositor" OFF) @@ -672,6 +673,24 @@ if(UNIX AND NOT APPLE) endif() endif() + if(WITH_OPENCOLORIO) + # use lib dir if available and nothing else specified + if(LIBDIR AND NOT OPENCOLORIO_ROOT_DIR) + set(OPENCOLORIO_ROOT_DIR ${LIBDIR}/ocio) + endif() + + find_package(OpenColorIO) + + set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES}) + set(OPENCOLORIO_LIBPATH) # TODO, remove and reference the absolute path everywhere + set(OPENCOLORIO_DEFINITIONS) + + if(NOT OPENCOLORIO_FOUND) + set(WITH_OPENCOLORIO OFF) + message(STATUS "OpenColorIO not found") + endif() + endif() + if(WITH_CYCLES_OSL) set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation") @@ -1065,6 +1084,14 @@ elseif(WIN32) set(OPENIMAGEIO_DEFINITIONS) endif() + if(WITH_OPENCOLORIO) + set(OPENCOLORIO ${LIBDIR}/opencolorio) + set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include) + set(OPENCOLORIO_LIBRARIES OpenColorIO) + set_lib_path(OPENCOLORIO_LIBPATH "opencolorio/lib") + set(OPENCOLORIO_DEFINITIONS) + endif() + set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib") # MSVC only, Mingw doesnt need @@ -1236,6 +1263,14 @@ elseif(WIN32) set(OPENIMAGEIO_DEFINITIONS) endif() + if(WITH_OPENCOLORIO) + set(OPENCOLORIO ${LIBDIR}/opencolorio) + set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include) + set(OPENCOLORIO_LIBRARIES OpenColorIO) + set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib) + set(OPENCOLORIO_DEFINITIONS) + endif() + set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152") ## DISABLE - causes linking errors @@ -1482,6 +1517,14 @@ elseif(APPLE) set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD") endif() + if(WITH_OPENCOLORIO) + set(OPENCOLORIO ${LIBDIR}/opencolorio) + set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include) + set(OPENCOLORIO_LIBRARIES OpenColorIO tinyxml yaml-cpp) + set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib) + set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD") + endif() + if(WITH_CYCLES_OSL) set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation") @@ -1885,6 +1928,7 @@ if(FIRST_RUN) info_cfg_option(WITH_INTERNATIONAL) info_cfg_option(WITH_INPUT_NDOF) info_cfg_option(WITH_CYCLES) + info_cfg_option(WITH_OPENCOLORIO) info_cfg_text("Compiler Options:") info_cfg_option(WITH_BUILDINFO) |