File 0001-Use-more-GNUInstallDirs.patch of Package exiv2

From fc74fddc10032dd9487ee8102aa84a8baca71578 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date: Sun, 20 Aug 2017 21:50:15 +0200
Subject: [PATCH] Use more GNUInstallDirs

Conveniently fixes multiarch install dir issues.

(cherry picked from commit aa6374b202bc5b2fbf67c3dded844d994d27246d)
---
 CMakeLists.txt         | 2 ++
 config/CMakeChecks.txt | 2 --
 config/exiv2.pc.cmake  | 4 ++--
 po/CMakeLists.txt      | 2 +-
 samples/CMakeLists.txt | 2 +-
 src/CMakeLists.txt     | 6 +++++-
 6 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7034bb67..23047949 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,8 @@ else()
     SET(CMAKE_MACOSX_RPATH 1)
 endif()
 
+INCLUDE( GNUInstallDirs )
+
 SET( PACKAGE_COPYRIGHT      "Andreas Huggel" )
 SET( PACKAGE_BUGREPORT      "ahuggel@gmx.net" )
 SET( PACKAGE                "exiv2" )
diff --git a/config/CMakeChecks.txt b/config/CMakeChecks.txt
index 77922930..5d4d59ab 100644
--- a/config/CMakeChecks.txt
+++ b/config/CMakeChecks.txt
@@ -37,8 +37,6 @@ INCLUDE( CheckSymbolExists )
 INCLUDE( CheckCSourceCompiles )
 INCLUDE( CheckCXXSourceCompiles )
 
-INCLUDE( GNUInstallDirs )
-
 INCLUDE( FindIconv )
 
 SET( STDC_HEADERS ON )
diff --git a/config/exiv2.pc.cmake b/config/exiv2.pc.cmake
index 256f8ac6..afc16e2b 100644
--- a/config/exiv2.pc.cmake
+++ b/config/exiv2.pc.cmake
@@ -1,7 +1,7 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
-libdir=${prefix}/lib
-includedir=${prefix}/include
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
 
 Name: exiv2
 Description: Exif and IPTC metadata library and tools
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 63b37733..69e8414b 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -9,7 +9,7 @@
 FILE(GLOB PO_FILES *.po)
 
 if ( NOT MSVC )
-	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_BINDIR})
 endif()
 
 UPDATE_TRANSLATIONS(exiv2 ${PO_FILES})
diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt
index 9690aa0e..0b58f6d8 100644
--- a/samples/CMakeLists.txt
+++ b/samples/CMakeLists.txt
@@ -6,7 +6,7 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
 if ( NOT MSVC )
-	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_BINDIR})
 endif()
 
 include_directories("${CMAKE_SOURCE_DIR}/include" "${CMAKE_SOURCE_DIR}/src")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index aecd6215..58de15f6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -308,7 +308,11 @@ IF (CYGWIN OR MINGW)
     TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR}  psapi ws2_32 )
 ENDIF(CYGWIN OR MINGW)
 
-INSTALL( TARGETS exiv2lib ${INSTALL_TARGET_STANDARD_ARGS} )
+INSTALL(TARGETS exiv2lib
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
 
 include(../CMake_msvc.txt)
 msvc_runtime_configure(${EXIV2_ENABLE_SHARED} ${EXIV2_ENABLE_DYNAMIC_RUNTIME})
-- 
2.14.1

openSUSE Build Service is sponsored by