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

0001 # - Try to find the Exiv2 library
0002 #
0003 #  EXIV2_MIN_VERSION - You can set this variable to the minimum version you need
0004 #                      before doing FIND_PACKAGE(Exiv2). The default is 0.12.
0005 #
0006 # Once done this will define
0007 #
0008 #  EXIV2_FOUND - system has libexiv2
0009 #  EXIV2_INCLUDE_DIR - the libexiv2 include directory
0010 #  EXIV2_LIBRARIES - Link these to use libexiv2
0011 #  EXIV2_DEFINITIONS - Compiler switches required for using libexiv2
0012 #
0013 # The minimum required version of Exiv2 can be specified using the
0014 # standard syntax, e.g. find_package(Exiv2 0.17)
0015 #
0016 # For compatibility, also the variable EXIV2_MIN_VERSION can be set to the minimum version
0017 # you need before doing FIND_PACKAGE(Exiv2). The default is 0.12.
0018 
0019 # Copyright (c) 2010, Alexander Neundorf, <neundorf@kde.org>
0020 # Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
0021 #
0022 # Redistribution and use is allowed according to the terms of the BSD license.
0023 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0024 
0025 # Support EXIV2_MIN_VERSION for compatibility:
0026 if(NOT Exiv2_FIND_VERSION)
0027   set(Exiv2_FIND_VERSION "${EXIV2_MIN_VERSION}")
0028 endif(NOT Exiv2_FIND_VERSION)
0029 
0030 # the minimum version of exiv2 we require
0031 if(NOT Exiv2_FIND_VERSION)
0032   set(Exiv2_FIND_VERSION "0.12")
0033 endif(NOT Exiv2_FIND_VERSION)
0034 
0035 
0036 if (NOT WIN32)
0037    # use pkg-config to get the directories and then use these values
0038    # in the FIND_PATH() and FIND_LIBRARY() calls
0039    find_package(PkgConfig)
0040    pkg_check_modules(PC_EXIV2 QUIET exiv2)
0041    set(EXIV2_DEFINITIONS ${PC_EXIV2_CFLAGS_OTHER})
0042 endif (NOT WIN32)
0043 
0044 
0045 find_path(EXIV2_INCLUDE_DIR NAMES exiv2/exif.hpp
0046           HINTS
0047           ${PC_EXIV2_INCLUDEDIR}
0048           ${PC_EXIV2_INCLUDE_DIRS}
0049         )
0050 
0051 find_library(EXIV2_LIBRARY NAMES exiv2 libexiv2
0052              HINTS
0053              ${PC_EXIV2_LIBDIR}
0054              ${PC_EXIV2_LIBRARY_DIRS}
0055             )
0056 
0057 
0058 # Get the version number from exiv2/version.hpp and store it in the cache:
0059 if(EXIV2_INCLUDE_DIR  AND NOT  EXIV2_VERSION)
0060   file(READ ${EXIV2_INCLUDE_DIR}/exiv2/version.hpp EXIV2_VERSION_CONTENT)
0061   string(REGEX MATCH "#define EXIV2_MAJOR_VERSION +\\( *([0-9]+) *\\)"  _dummy "${EXIV2_VERSION_CONTENT}")
0062   set(EXIV2_VERSION_MAJOR "${CMAKE_MATCH_1}")
0063 
0064   string(REGEX MATCH "#define EXIV2_MINOR_VERSION +\\( *([0-9]+) *\\)"  _dummy "${EXIV2_VERSION_CONTENT}")
0065   set(EXIV2_VERSION_MINOR "${CMAKE_MATCH_1}")
0066 
0067   string(REGEX MATCH "#define EXIV2_PATCH_VERSION +\\( *([0-9]+) *\\)"  _dummy "${EXIV2_VERSION_CONTENT}")
0068   set(EXIV2_VERSION_PATCH "${CMAKE_MATCH_1}")
0069 
0070   set(EXIV2_VERSION "${EXIV2_VERSION_MAJOR}.${EXIV2_VERSION_MINOR}.${EXIV2_VERSION_PATCH}" CACHE STRING "Version number of Exiv2" FORCE)
0071 endif(EXIV2_INCLUDE_DIR  AND NOT  EXIV2_VERSION)
0072 
0073 set(EXIV2_LIBRARIES "${EXIV2_LIBRARY}")
0074 
0075 include(FindPackageHandleStandardArgs)
0076 find_package_handle_standard_args(Exiv2  REQUIRED_VARS  EXIV2_LIBRARY EXIV2_INCLUDE_DIR
0077                                          VERSION_VAR  EXIV2_VERSION)
0078 
0079 mark_as_advanced(EXIV2_INCLUDE_DIR EXIV2_LIBRARY)
0080