47e2a97512c1c57f8498224093285a7142127318Josh Andler# This file was taken from the openjpeg library:
47e2a97512c1c57f8498224093285a7142127318Josh Andler#
47e2a97512c1c57f8498224093285a7142127318Josh Andler# http://code.google.com/p/openjpeg/source/browse/trunk/cmake/FindLCMS2.cmake?r=1987
47e2a97512c1c57f8498224093285a7142127318Josh Andler#
47e2a97512c1c57f8498224093285a7142127318Josh Andler# Thanks!
47e2a97512c1c57f8498224093285a7142127318Josh Andler
47e2a97512c1c57f8498224093285a7142127318Josh Andler# - Find LCMS2 library
47e2a97512c1c57f8498224093285a7142127318Josh Andler# Find the native LCMS2 includes and library
47e2a97512c1c57f8498224093285a7142127318Josh Andler# Once done this will define
47e2a97512c1c57f8498224093285a7142127318Josh Andler#
47e2a97512c1c57f8498224093285a7142127318Josh Andler# LCMS2_INCLUDE_DIR - Where to find lcms2.h, etc.
47e2a97512c1c57f8498224093285a7142127318Josh Andler# LCMS2_LIBRARIES - Libraries to link against to use LCMS2.
47e2a97512c1c57f8498224093285a7142127318Josh Andler# LCMS2_FOUND - If false, do not try to use LCMS2.
47e2a97512c1c57f8498224093285a7142127318Josh Andler#
47e2a97512c1c57f8498224093285a7142127318Josh Andler# also defined, but not for general use are
47e2a97512c1c57f8498224093285a7142127318Josh Andler# LCMS2_LIBRARY - Where to find the LCMS2 library.
47e2a97512c1c57f8498224093285a7142127318Josh Andler
47e2a97512c1c57f8498224093285a7142127318Josh Andler#=============================================================================
47e2a97512c1c57f8498224093285a7142127318Josh Andler#=============================================================================
47e2a97512c1c57f8498224093285a7142127318Josh Andler
47e2a97512c1c57f8498224093285a7142127318Josh Andlerfind_path(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include)
47e2a97512c1c57f8498224093285a7142127318Josh Andler
47e2a97512c1c57f8498224093285a7142127318Josh Andlerset(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static)
47e2a97512c1c57f8498224093285a7142127318Josh Andler
47e2a97512c1c57f8498224093285a7142127318Josh Andlerfind_library(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} )
47e2a97512c1c57f8498224093285a7142127318Josh Andler
47e2a97512c1c57f8498224093285a7142127318Josh Andlermark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY)
47e2a97512c1c57f8498224093285a7142127318Josh Andler
47e2a97512c1c57f8498224093285a7142127318Josh Andler# handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if
47e2a97512c1c57f8498224093285a7142127318Josh Andler# all listed variables are TRUE
47e2a97512c1c57f8498224093285a7142127318Josh Andlerinclude(FindPackageHandleStandardArgs)
47e2a97512c1c57f8498224093285a7142127318Josh AndlerFIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR)
47e2a97512c1c57f8498224093285a7142127318Josh Andler
47e2a97512c1c57f8498224093285a7142127318Josh Andlerif(LCMS2_FOUND)
47e2a97512c1c57f8498224093285a7142127318Josh Andlerset( LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
47e2a97512c1c57f8498224093285a7142127318Josh Andlerset( LCMS2_LIBRARIES ${LCMS2_LIBRARY} )
47e2a97512c1c57f8498224093285a7142127318Josh Andlerendif()
47e2a97512c1c57f8498224093285a7142127318Josh Andler