Use GNUInstallDirs cmake fragment.

This allows setting the man page installation directory, e.g.:
cmake -DCMAKE_INSTALL_MANDIR:PATH=share/man ...
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eea9be1..23b06b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@
 INCLUDE(CheckCSourceCompiles)
 INCLUDE(CheckStructHasMember)
 INCLUDE(TestBigEndian)
+INCLUDE(GNUInstallDirs)
 
 SET(PACKAGE "libzip")
 SET(PACKAGE_NAME ${PACKAGE})
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 4934f8b..0831a10 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -105,44 +105,42 @@
 
 # installation
 
-SET(MAN_PATH man)
-
 FOREACH(MAN_PAGE ${MAN1_PAGES})
-  INSTALL(FILES ${MAN_PAGE}.${MANFMT} DESTINATION ${MAN_PATH}/man1
+  INSTALL(FILES ${MAN_PAGE}.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
     RENAME ${MAN_PAGE}.1)
 ENDFOREACH(MAN_PAGE ${PROGRAMS})
 FOREACH(MAN_PAGE ${MAN3_PAGES})
-  INSTALL(FILES ${MAN_PAGE}.${MANFMT} DESTINATION ${MAN_PATH}/man3
+  INSTALL(FILES ${MAN_PAGE}.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
     RENAME ${MAN_PAGE}.3)
 ENDFOREACH(MAN_PAGE ${PROGRAMS})
 # TODO: usually symlinks, but I only know how to do this way
-INSTALL(FILES zip_error_clear.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_error_clear.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_file_error_clear.3)
-INSTALL(FILES zip_error_get.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_error_get.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_file_error_get.3)
-INSTALL(FILES zip_error_init.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_error_init.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_error_init_with_code.3)
-INSTALL(FILES zip_file_extra_field_delete.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_file_extra_field_delete.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_file_extra_field_delete_by_id.3)
-INSTALL(FILES zip_file_extra_field_get.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_file_extra_field_get.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_file_extra_field_get_by_id.3)
-INSTALL(FILES zip_file_extra_fields_count.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_file_extra_fields_count.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_file_extra_fields_count_by_id.3)
-INSTALL(FILES zip_file_add.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_file_add.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_file_replace.3)
-INSTALL(FILES zip_fopen.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_fopen.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_fopen_index.3)
-INSTALL(FILES zip_fopen_encrypted.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_fopen_encrypted.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_fopen_index_encrypted.3)
-INSTALL(FILES zip_open.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_open.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_open_from_source.3)
-INSTALL(FILES zip_add.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_add.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_replace.3)
-INSTALL(FILES zip_source_function.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_source_function.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_source_function_create.3)
-INSTALL(FILES zip_stat.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_stat.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_stat_index.3)
-INSTALL(FILES zip_file_strerror.${MANFMT} DESTINATION ${MAN_PATH}/man3
+INSTALL(FILES zip_file_strerror.${MANFMT} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
   RENAME zip_strerror.3)
 
 # custom maintainer targets