aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Giboudeaux <christophe@krop.fr>2018-11-20 14:34:59 +0100
committerChristophe Giboudeaux <christophe@krop.fr>2018-11-20 14:36:01 +0100
commit19e6a585a7aecbead7aed851ddabbb940155b446 (patch)
treed0ae986b6ef47fe191dda8a77309dd9e7fc0ce63
parentfe22302d2d4dbf2d47f27e36814cd10784d97a41 (diff)
downloadextra-cmake-modules-19e6a585a7aecbead7aed851ddabbb940155b446.tar.gz
extra-cmake-modules-19e6a585a7aecbead7aed851ddabbb940155b446.tar.bz2
Rename FindExiv2 to FindLibExiv2.v5.53.0-rc1v5.53.0
New users can use this module instead of adding a copy of the old FindExiv2.cmake module.
-rw-r--r--docs/find-module/FindExiv2.rst1
-rw-r--r--docs/find-module/FindLibExiv2.rst1
-rw-r--r--find-modules/FindLibExiv2.cmake (renamed from find-modules/FindExiv2.cmake)66
3 files changed, 31 insertions, 37 deletions
diff --git a/docs/find-module/FindExiv2.rst b/docs/find-module/FindExiv2.rst
deleted file mode 100644
index 272d09d8..00000000
--- a/docs/find-module/FindExiv2.rst
+++ /dev/null
@@ -1 +0,0 @@
-.. ecm-module:: ../../find-modules/FindExiv2.cmake
diff --git a/docs/find-module/FindLibExiv2.rst b/docs/find-module/FindLibExiv2.rst
new file mode 100644
index 00000000..35552a7c
--- /dev/null
+++ b/docs/find-module/FindLibExiv2.rst
@@ -0,0 +1 @@
+.. ecm-module:: ../../find-modules/FindLibExiv2.cmake
diff --git a/find-modules/FindExiv2.cmake b/find-modules/FindLibExiv2.cmake
index 91b1528e..935cee2c 100644
--- a/find-modules/FindExiv2.cmake
+++ b/find-modules/FindLibExiv2.cmake
@@ -1,34 +1,33 @@
#.rst:
-# FindExiv2
-# ---------
+# FindLibExiv2
+# ------------
#
# Try to find the Exiv2 library.
#
# This will define the following variables:
#
-# ``Exiv2_FOUND``
-# System has Exiv2.
+# ``LibExiv2_FOUND``
+# System has LibExiv2.
#
-# ``Exiv2_VERSION``
-# The version of Exiv2.
+# ``LibExiv2_VERSION``
+# The version of LibExiv2.
#
-# ``Exiv2_INCLUDE_DIRS``
+# ``LibExiv2_INCLUDE_DIRS``
# This should be passed to target_include_directories() if
# the target is not used for linking.
#
-# ``Exiv2_LIBRARIES``
-# The Exiv2 library.
+# ``LibExiv2_LIBRARIES``
+# The LibExiv2 library.
# This can be passed to target_link_libraries() instead of
-# the ``Exiv2::Exiv2`` target
+# the ``LibExiv2::LibExiv2`` target
#
-# If ``Exiv2_FOUND`` is TRUE, the following imported target
+# If ``LibExiv2_FOUND`` is TRUE, the following imported target
# will be available:
#
-# ``Exiv2::Exiv2``
+# ``LibExiv2::LibExiv2``
# The Exiv2 library
#
# Since 5.53.0.
-# TODO KF6: Rename to FindLibExiv2.cmake
#
#=============================================================================
# Copyright (c) 2018, Christophe Giboudeaux, <christophe@krop.fr>
@@ -63,21 +62,21 @@
find_package(PkgConfig QUIET)
pkg_check_modules(PC_EXIV2 QUIET exiv2)
-find_path(Exiv2_INCLUDE_DIRS NAMES exiv2/exif.hpp
+find_path(LibExiv2_INCLUDE_DIRS NAMES exiv2/exif.hpp
HINTS ${PC_EXIV2_INCLUDEDIR}
)
-find_library(Exiv2_LIBRARIES NAMES exiv2 libexiv2
+find_library(LibExiv2_LIBRARIES NAMES exiv2 libexiv2
HINTS ${PC_EXIV2_LIBRARY_DIRS}
)
-set(Exiv2_VERSION ${PC_EXIV2_VERSION})
+set(LibExiv2_VERSION ${PC_EXIV2_VERSION})
-if(NOT Exiv2_VERSION AND DEFINED Exiv2_INCLUDE_DIRS)
+if(NOT LibExiv2_VERSION AND DEFINED LibExiv2_INCLUDE_DIRS)
# With exiv >= 0.27, the version #defines are in exv_conf.h instead of version.hpp
foreach(_exiv2_version_file "version.hpp" "exv_conf.h")
- if(EXISTS "${Exiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}")
- file(READ "${Exiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}" _exiv_version_file_content)
+ if(EXISTS "${LibExiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}")
+ file(READ "${LibExiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}" _exiv_version_file_content)
string(REGEX MATCH "#define EXIV2_MAJOR_VERSION[ ]+\\([0-9]+\\)" EXIV2_MAJOR_VERSION_MATCH ${_exiv_version_file_content})
string(REGEX MATCH "#define EXIV2_MINOR_VERSION[ ]+\\([0-9]+\\)" EXIV2_MINOR_VERSION_MATCH ${_exiv_version_file_content})
string(REGEX MATCH "#define EXIV2_PATCH_VERSION[ ]+\\([0-9]+\\)" EXIV2_PATCH_VERSION_MATCH ${_exiv_version_file_content})
@@ -89,33 +88,28 @@ if(NOT Exiv2_VERSION AND DEFINED Exiv2_INCLUDE_DIRS)
endif()
endforeach()
- set(Exiv2_VERSION "${EXIV2_MAJOR_VERSION}.${EXIV2_MINOR_VERSION}.${EXIV2_PATCH_VERSION}")
+ set(LibExiv2_VERSION "${EXIV2_MAJOR_VERSION}.${EXIV2_MINOR_VERSION}.${EXIV2_PATCH_VERSION}")
endif()
-# Deprecated, for backward compatibility
-set(EXIV2_INCLUDE_DIR "${Exiv2_INCLUDE_DIRS}")
-set(EXIV2_LIBRARIES "${Exiv2_LIBRARIES}")
-set(EXIV2_VERSION "${Exiv2_VERSION}")
-
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Exiv2
- FOUND_VAR Exiv2_FOUND
- REQUIRED_VARS Exiv2_LIBRARIES Exiv2_INCLUDE_DIRS
- VERSION_VAR Exiv2_VERSION
+find_package_handle_standard_args(LibExiv2
+ FOUND_VAR LibExiv2_FOUND
+ REQUIRED_VARS LibExiv2_LIBRARIES LibExiv2_INCLUDE_DIRS
+ VERSION_VAR LibExiv2_VERSION
)
-mark_as_advanced(Exiv2_INCLUDE_DIRS Exiv2_LIBRARIES)
+mark_as_advanced(LibExiv2_INCLUDE_DIRS LibExiv2_LIBRARIES)
-if(Exiv2_FOUND AND NOT TARGET Exiv2::Exiv2)
- add_library(Exiv2::Exiv2 UNKNOWN IMPORTED)
- set_target_properties(Exiv2::Exiv2 PROPERTIES
- IMPORTED_LOCATION "${Exiv2_LIBRARIES}"
- INTERFACE_INCLUDE_DIRECTORIES "${Exiv2_INCLUDE_DIRS}"
+if(LibExiv2_FOUND AND NOT TARGET LibExiv2::LibExiv2)
+ add_library(LibExiv2::LibExiv2 UNKNOWN IMPORTED)
+ set_target_properties(LibExiv2::LibExiv2 PROPERTIES
+ IMPORTED_LOCATION "${LibExiv2_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LibExiv2_INCLUDE_DIRS}"
)
endif()
include(FeatureSummary)
-set_package_properties(Exiv2 PROPERTIES
+set_package_properties(LibExiv2 PROPERTIES
URL "http://www.exiv2.org"
DESCRIPTION "Image metadata support"
)