Warning, /frameworks/kdelibs4support/cmake/modules/FindLCMS.cmake is written in an unsupported language. File is not indexed.

0001 # - Find LCMS
0002 # Find the LCMS (Little Color Management System) library and includes and
0003 # This module defines
0004 #  LCMS_INCLUDE_DIR, where to find lcms.h
0005 #  LCMS_LIBRARIES, the libraries needed to use LCMS.
0006 #  LCMS_DOT_VERSION, The version number of the LCMS library, e.g. "1.19"
0007 #  LCMS_VERSION, Similar to LCMS_DOT_VERSION, but without the dots, e.g. "119"
0008 #  LCMS_FOUND, If false, do not try to use LCMS.
0009 #
0010 # The minimum required version of LCMS can be specified using the
0011 # standard syntax, e.g. find_package(LCMS 1.10)
0012 
0013 # Copyright (c) 2008, Adrian Page, <adrian@pagenet.plus.com>
0014 # Copyright (c) 2009, Cyrille Berger, <cberger@cberger.net>
0015 #
0016 # Redistribution and use is allowed according to the terms of the BSD license.
0017 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0018 
0019 
0020 # use pkg-config to get the directories and then use these values
0021 # in the FIND_PATH() and FIND_LIBRARY() calls
0022 if(NOT WIN32)
0023    find_package(PkgConfig)
0024    pkg_check_modules(PC_LCMS lcms)
0025    set(LCMS_DEFINITIONS ${PC_LCMS_CFLAGS_OTHER})
0026 endif(NOT WIN32)
0027 
0028 find_path(LCMS_INCLUDE_DIR lcms.h
0029    HINTS
0030    ${PC_LCMS_INCLUDEDIR}
0031    ${PC_LCMS_INCLUDE_DIRS}
0032    PATH_SUFFIXES lcms liblcms1
0033 )
0034 
0035 find_library(LCMS_LIBRARIES NAMES lcms liblcms lcms-1 liblcms-1
0036    HINTS
0037    ${PC_LCMS_LIBDIR}
0038    ${PC_LCMS_LIBRARY_DIRS}
0039    PATH_SUFFIXES lcms
0040 )
0041 
0042 # Store the LCMS version number in the cache, so we don't have to search every time again
0043 if(LCMS_INCLUDE_DIR  AND NOT  LCMS_VERSION)
0044    file(READ ${LCMS_INCLUDE_DIR}/lcms.h LCMS_VERSION_CONTENT)
0045    string(REGEX MATCH "#define LCMS_VERSION[ ]*[0-9]*\n" LCMS_VERSION_MATCH ${LCMS_VERSION_CONTENT})
0046    if(LCMS_VERSION_MATCH)
0047       string(REGEX REPLACE "#define LCMS_VERSION[ ]*([0-9]*)\n" "\\1" _LCMS_VERSION ${LCMS_VERSION_MATCH})
0048       string(SUBSTRING ${_LCMS_VERSION} 0 1 LCMS_MAJOR_VERSION)
0049       string(SUBSTRING ${_LCMS_VERSION} 1 2 LCMS_MINOR_VERSION)
0050    endif(LCMS_VERSION_MATCH)
0051    set(LCMS_VERSION "${LCMS_MAJOR_VERSION}${LCMS_MINOR_VERSION}" CACHE STRING "Version number of lcms" FORCE)
0052    set(LCMS_DOT_VERSION "${LCMS_MAJOR_VERSION}.${LCMS_MINOR_VERSION}" CACHE STRING "Version number of lcms split into components" FORCE)
0053 endif(LCMS_INCLUDE_DIR  AND NOT  LCMS_VERSION)
0054 
0055 include(FindPackageHandleStandardArgs)
0056 find_package_handle_standard_args(LCMS REQUIRED_VARS LCMS_LIBRARIES LCMS_INCLUDE_DIR
0057                                        VERSION_VAR LCMS_DOT_VERSION )
0058 
0059 mark_as_advanced(LCMS_INCLUDE_DIR LCMS_LIBRARIES LCMS_VERSION)
0060