File Fix-building-against-exiv2-0.27.patch of Package krename4

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 717d859..be33a09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,9 @@ set_package_properties(Taglib PROPERTIES
 set(EXIV2_MIN_VERSION "0.13") # AccessMode was added in 0.13
 macro_optional_find_package(Exiv2)
 macro_log_feature(EXIV2_FOUND "Exiv2" "A library to access image metadata" "http://www.exiv2.org" FALSE "")
+if (NOT EXIV2_VERSION VERSION_LESS "0.27")
+    set(HAVE_LIBEXIV2_0_27 TRUE)
+endif()
 
 IF(EXIV2_FOUND)
   ADD_DEFINITIONS( -DWITH_EXIV2 )
diff --git a/config-krename.h.cmake b/config-krename.h.cmake
index 862e40b..de25e6f 100644
--- a/config-krename.h.cmake
+++ b/config-krename.h.cmake
@@ -6,6 +6,9 @@
 /* have Exiv2 */
 #define HAVE_EXIV2 ${EXIV2_FOUND}
 
+/* Defined if we have libexiv2 >= 0.27 */
+#cmakedefine HAVE_LIBEXIV2_0_27
+
 /* have PoDoFo */
 #define HAVE_PODOFO 1
 
diff --git a/src/exiv2plugin.cpp b/src/exiv2plugin.cpp
index 39ac9e7..8c5c1cf 100644
--- a/src/exiv2plugin.cpp
+++ b/src/exiv2plugin.cpp
@@ -26,7 +26,11 @@
 #include <exiv2/exif.hpp>
 #include <exiv2/image.hpp>
 #include <exiv2/iptc.hpp>
-#include <exiv2/xmp.hpp>
+#ifdef HAVE_LIBEXIV2_0_27
+    #include <exiv2/xmp_exiv2.hpp>
+#else
+    #include <exiv2/xmp.hpp>
+#endif
 #include <exiv2/tags.hpp>
 
 #include "batchrenamer.h"
openSUSE Build Service is sponsored by