2020-02-25 18:07:49 +00:00
|
|
|
# - Try to find Exiv2 library
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
|
|
|
# Once done this will define
|
|
|
|
#
|
2020-02-25 18:07:49 +00:00
|
|
|
# EXIV2_FOUND - system has Exiv2
|
|
|
|
# EXIV2_INCLUDE_DIR - the Exiv2 include directory
|
|
|
|
# EXIV2_LIBRARIES - the libraries needed to use Exiv2
|
|
|
|
# EXIV2_DEFINITIONS - compiler switches required for using Exiv2
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
2020-02-25 18:07:49 +00:00
|
|
|
# Copyright (c) 2020, Ivailo Monev, <xakepa10@gmail.com>
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2019-05-03 05:12:31 +00:00
|
|
|
if(NOT WIN32)
|
2020-02-25 18:07:49 +00:00
|
|
|
include(FindPkgConfig)
|
2019-05-03 05:12:31 +00:00
|
|
|
pkg_check_modules(PC_EXIV2 QUIET exiv2)
|
|
|
|
|
2020-02-25 18:07:49 +00:00
|
|
|
set(EXIV2_INCLUDE_DIR ${PC_EXIV2_INCLUDE_DIRS})
|
|
|
|
set(EXIV2_LIBRARIES ${PC_EXIV2_LIBRARIES})
|
|
|
|
endif()
|
2019-05-03 05:12:31 +00:00
|
|
|
|
2020-02-25 18:07:49 +00:00
|
|
|
set(EXIV2_VERSION ${PC_EXIV2_VERSION})
|
|
|
|
set(EXIV2_DEFINITIONS ${PC_EXIV2_CFLAGS_OTHER})
|
2019-05-03 05:12:31 +00:00
|
|
|
|
2020-02-25 18:07:49 +00:00
|
|
|
if(NOT EXIV2_INCLUDE_DIR OR NOT EXIV2_LIBRARIES)
|
|
|
|
find_path(EXIV2_INCLUDE_DIR
|
|
|
|
NAMES exiv2/exif.hpp
|
|
|
|
HINTS $ENV{EXIV2DIR}/include
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-25 18:07:49 +00:00
|
|
|
find_library(EXIV2_LIBRARIES
|
|
|
|
NAMES exiv2
|
|
|
|
HINTS $ENV{EXIV2DIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2014-11-13 01:04:59 +02:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-02-25 18:07:49 +00:00
|
|
|
find_package_handle_standard_args(Exiv2
|
|
|
|
VERSION_VAR EXIV2_VERSION
|
|
|
|
REQUIRED_VARS EXIV2_LIBRARIES EXIV2_INCLUDE_DIR
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-25 18:07:49 +00:00
|
|
|
mark_as_advanced(EXIV2_INCLUDE_DIR EXIV2_LIBRARIES)
|