Commit e3af2640 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Implement cmake modules for finding ocio and oiio

OpenColorIO and OpenImageIO are utility libraries for Krita.
parent 2f51469e
# - Find OCIO
# Find the OCIO includes and library
# This module defines
# OCIO_INCLUDE_DIR, where to find OpenImageIO/version.h
# OCIO_LIBRARIES, the libraries needed to use OCIO.
# OCIO_VERSION, The value of OCIO_VERSION defined in oiio.h
# OCIO_FOUND, If false, do not try to use OCIO.
# Copyright (c) 2008, Adrian Page, <adrian@pagenet.plus.com>
# Copyright (c) 2009, Cyrille Berger, <cberger@cberger.net>
# Copyright (c) 2012, Boudewijn Rempt, <boud@valdyas.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if(OCIO_PATH)
message(STATUS "OCIO path explicitly specified: ${OCIO_PATH}")
endif()
if(OCIO_INCLUDE_PATH)
message(STATUS "OCIO INCLUDE_PATH explicitly specified: ${OCIO_INCLUDE_PATH}")
endif()
if(OCIO_LIBRARY_PATH)
message(STATUS "OCIO LIBRARY_PATH explicitly specified: ${OCIO_LIBRARY_PATH}")
endif()
find_path(OCIO_INCLUDE_DIR OpenColorIO.h
${OCIO_INCLUDE_PATH}
${OCIO_PATH}/include/
/usr/include
/usr/local/include
/sw/include
/opt/local/include
PATH_SUFFIXES OpenColorIO
DOC "The directory where OpenColorIO/OpenColorIO.h resides"
)
find_library(OCIO_LIBRARIES OpenColorIO
PATHS
${OCIO_LIBRARY_PATH}
${OCIO_PATH}/lib/
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
DOC "The OCIO library"
)
if(OCIO_INCLUDE_DIR AND OCIO_LIBRARIES)
set(OCIO_FOUND TRUE)
else(OCIO_INCLUDE_DIR AND OCIO_LIBRARIES)
set(OCIO_FOUND FALSE)
endif(OCIO_INCLUDE_DIR AND OCIO_LIBRARIES)
if (NOT OCIO_FOUND)
if(NOT OCIO_FIND_QUIETLY)
if(OCIO_FIND_REQUIRED)
message(FATAL_ERROR "Required package OpenColorIO NOT found")
else(OCIO_FIND_REQUIRED)
message(STATUS "OpenColorIO NOT found")
endif(OCIO_FIND_REQUIRED)
endif(NOT OCIO_FIND_QUIETLY)
endif (NOT OCIO_FOUND)
mark_as_advanced(OCIO_INCLUDE_DIR OCIO_LIBRARIES)
# - Find OIIO
# Find the OIIO includes and library
# This module defines
# OIIO_INCLUDE_DIR, where to find OpenImageIO/version.h
# OIIO_LIBRARIES, the libraries needed to use OIIO.
# OIIO_VERSION, The value of OIIO_VERSION defined in oiio.h
# OIIO_FOUND, If false, do not try to use OIIO.
# Copyright (c) 2008, Adrian Page, <adrian@pagenet.plus.com>
# Copyright (c) 2009, Cyrille Berger, <cberger@cberger.net>
# Copyright (c) 2012, Boudewijn Rempt, <boud@valdyas.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if(OIIO_PATH)
message(STATUS "OIIO path explicitly specified: ${OIIO_PATH}")
endif()
if(OIIO_INCLUDE_PATH)
message(STATUS "OIIO INCLUDE_PATH explicitly specified: ${OIIO_INCLUDE_PATH}")
endif()
if(OIIO_LIBRARY_PATH)
message(STATUS "OIIO LIBRARY_PATH explicitly specified: ${OIIO_LIBRARY_PATH}")
endif()
find_path(OIIO_INCLUDE_DIR OpenImageIO/version.h
${OIIO_INCLUDE_PATH}
${OIIO_PATH}/include/
/usr/include
/usr/local/include
/sw/include
/opt/local/include
DOC "The directory where OpenImageIO/version.h resides")
)
find_library(OIIO_LIBRARIES
NAMES OIIO OpenImageIO
PATHS
${OIIO_LIBRARY_PATH}
${OIIO_PATH}/lib/
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
DOC "The OIIO library")
)
if(OIIO_INCLUDE_DIR AND OIIO_LIBRARIES)
set(OIIO_FOUND TRUE)
else(OIIO_INCLUDE_DIR AND OIIO_LIBRARIES)
set(OIIO_FOUND FALSE)
endif(OIIO_INCLUDE_DIR AND OIIO_LIBRARIES)
mark_as_advanced(OIIO_INCLUDE_DIR OIIO_LIBRARIES)
......@@ -32,6 +32,11 @@ else(HAVE_OPENGL)
endif(HAVE_OPENGL)
endif (NOT WIN32)
macro_optional_find_package(OCIO)
macro_log_feature(OCIO_FOUND "OCIO" "The OpenColorIO Library" "http://www.opencolorio.org" FALSE "" "Required by the Krita LUT docker")
macro_bool_to_01(OCIO_FOUND HAVE_OCIO)
configure_file(config-ocio.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ocio.h )
if(UNIX)
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};m")
endif(UNIX)
......
/* config-ocio.h. Generated by cmake from config-ocio.h.cmake */
/* Define if you have ocio, the OpenColorIO Library */
#cmakedefine HAVE_OCIO 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment