FindLCMS.cmake revision 0586e948b7fc1e97fa7cdddf926e4ec768a40392
6643N/A# - Try to find LCMS
6643N/A# Once done this will define
6643N/A#
6643N/A# LCMS_FOUND - system has LCMS
6643N/A# LCMS_INCLUDE_DIRS - the LCMS include directory
6643N/A# LCMS_LIBRARIES - Link these to use LCMS
6643N/A# LCMS_DEFINITIONS - Compiler switches required for using LCMS
6643N/A#
6643N/A# Copyright (c) 2008 Joshua L. Blocher <verbalshadow@gmail.com>
6643N/A#
6643N/A# Redistribution and use is allowed according to the terms of the New
6643N/A# BSD license.
6643N/A# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
6643N/A#
6643N/A
6643N/A
6643N/Aif (LCMS_LIBRARIES AND LCMS_INCLUDE_DIRS)
6643N/A # in cache already
6643N/A set(LCMS_FOUND TRUE)
6643N/Aelse (LCMS_LIBRARIES AND LCMS_INCLUDE_DIRS)
6643N/A # use pkg-config to get the directories and then use these values
6643N/A # in the FIND_PATH() and FIND_LIBRARY() calls
6643N/A if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
6643N/A include(UsePkgConfig)
7077N/A pkgconfig(lcms _LCMS_INCLUDEDIR _LCMS_LIBDIR _LCMS_LDFLAGS _LCMS_CFLAGS)
6643N/A else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
7077N/A find_package(PkgConfig)
6643N/A if (PKG_CONFIG_FOUND)
6643N/A pkg_check_modules(_LCMS lcms)
6643N/A endif (PKG_CONFIG_FOUND)
6643N/A endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
6643N/A find_path(LCMS_INCLUDE_DIR
6643N/A NAMES
6643N/A lcms.h
6643N/A PATHS
6643N/A ${_LCMS_INCLUDEDIR}
6643N/A /usr/include
6643N/A /usr/local/include
6643N/A /opt/local/include
6643N/A /sw/include
6643N/A PATH_SUFFIXES
6643N/A lcms
6643N/A )
6643N/A
6643N/A find_library(LCMS_LIBRARY
6643N/A NAMES
6643N/A lcms
7077N/A PATHS
7077N/A ${_LCMS_LIBDIR}
7077N/A /usr/lib
7077N/A /usr/local/lib
7077N/A /opt/local/lib
7077N/A /sw/lib
7077N/A )
7077N/A
7077N/A if (LCMS_LIBRARY)
7077N/A set(LCMS_FOUND TRUE)
7077N/A endif (LCMS_LIBRARY)
7077N/A
7077N/A set(LCMS_INCLUDE_DIRS
7077N/A ${LCMS_INCLUDE_DIR}
7077N/A )
7077N/A
6643N/A if (LCMS_FOUND)
7183N/A set(LCMS_LIBRARIES
6643N/A ${LCMS_LIBRARIES}
7077N/A ${LCMS_LIBRARY}
6643N/A )
6643N/A endif (LCMS_FOUND)
6643N/A
7183N/A if (LCMS_INCLUDE_DIRS AND LCMS_LIBRARIES)
7183N/A set(LCMS_FOUND TRUE)
7183N/A endif (LCMS_INCLUDE_DIRS AND LCMS_LIBRARIES)
6643N/A
6643N/A if (LCMS_FOUND)
6643N/A if (NOT LCMS_FIND_QUIETLY)
6643N/A message(STATUS "Found LCMS: ${LCMS_LIBRARIES}")
6643N/A endif (NOT LCMS_FIND_QUIETLY)
6643N/A else (LCMS_FOUND)
6643N/A if (LCMS_FIND_REQUIRED)
6643N/A message(FATAL_ERROR "Could not find LCMS")
6643N/A endif (LCMS_FIND_REQUIRED)
6643N/A endif (LCMS_FOUND)
6643N/A
6643N/A # show the LCMS_INCLUDE_DIRS and LCMS_LIBRARIES variables only in the advanced view
6643N/A mark_as_advanced(LCMS_INCLUDE_DIRS LCMS_LIBRARIES)
6643N/A
6643N/Aendif (LCMS_LIBRARIES AND LCMS_INCLUDE_DIRS)
6643N/A
6643N/A