From: Boyuan Yang <byang@debian.org>
Date: Fri, 6 May 2022 14:40:21 -0400
Subject: Use GNUInstallDirs

---
 CMakeLists.txt     | 4 +++-
 doc/CMakeLists.txt | 4 ++--
 src/CMakeLists.txt | 8 ++++----
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 606b551..7b5de31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,8 @@
 project(mini18n)
 
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.0.2)
+
+include(GNUInstallDirs)
 
 set(MINI18N_VERSION_MAJOR 0)
 set(MINI18N_VERSION_MINOR 2)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 7ccdfd7..19f12eb 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,2 +1,2 @@
-install(FILES "mini18n.3" DESTINATION "share/man/man3")
-install(FILES "mini18n_set_locale.3" DESTINATION "share/man/man3")
+install(FILES "mini18n.3" DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
+install(FILES "mini18n_set_locale.3" DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cce12dc..ea24b76 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -25,7 +25,7 @@ set_target_properties(mini18n-shared PROPERTIES OUTPUT_NAME mini18n SOVERSION 1
 add_library(mini18n-static STATIC ${mini18n_SOURCES})
 set_target_properties(mini18n-static PROPERTIES OUTPUT_NAME mini18n)
 
-install(TARGETS mini18n-shared DESTINATION "lib")
-install(TARGETS mini18n-static DESTINATION "lib")
-install(FILES mini18n.h DESTINATION "include")
-install(FILES mini18n-multi.h DESTINATION "include")
+install(TARGETS mini18n-shared DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+install(TARGETS mini18n-static DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+install(FILES mini18n.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+install(FILES mini18n-multi.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
