Simplify installation.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 112e887..f8f8ff4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,7 +29,6 @@
include(CheckCSourceCompiles)
include(CheckStructHasMember)
include(TestBigEndian)
-include(GNUInstallDirs)
if(ENABLE_COMMONCRYPTO)
check_include_files(CommonCrypto/CommonCrypto.h COMMONCRYPTO_FOUND)
else()
@@ -347,7 +346,7 @@
endforeach()
configure_file(libzip.pc.in libzip.pc @ONLY)
if(LIBZIP_DO_INSTALL)
- install(FILES ${PROJECT_BINARY_DIR}/libzip.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ install(FILES ${PROJECT_BINARY_DIR}/libzip.pc DESTINATION lib/pkgconfig)
endif()
# fixed size integral types
@@ -476,14 +475,14 @@
COMPATIBILITY AnyNewerVersion)
configure_package_config_file("${PROJECT_NAME}.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libzip
+ INSTALL_DESTINATION lib/cmake/libzip
PATH_VARS CMAKE_INSTALL_BINDIR CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR)
if(LIBZIP_DO_INSTALL)
install(EXPORT ${PROJECT_NAME}-targets
NAMESPACE libzip::
FILE ${PROJECT_NAME}-targets.cmake
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
+ DESTINATION lib/cmake/${PROJECT_NAME}
)
endif()
@@ -493,9 +492,9 @@
# installation
if(LIBZIP_DO_INSTALL)
- install(FILES ${PROJECT_BINARY_DIR}/zipconf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ install(FILES ${PROJECT_BINARY_DIR}/zipconf.h DESTINATION include)
install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
+ DESTINATION lib/cmake/${PROJECT_NAME}
)
endif()
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 9a6a677..d710734 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,7 +1,7 @@
include(CheckFunctionExists)
if(LIBZIP_DO_INSTALL)
- install(FILES zip.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ install(FILES zip.h DESTINATION include)
endif()
set(CMAKE_C_VISIBILITY_PRESET hidden)
@@ -220,8 +220,8 @@
if(LIBZIP_DO_INSTALL)
install(TARGETS zip
EXPORT ${PROJECT_NAME}-targets
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ INCLUDES DESTINATION include
+ LIBRARY DESTINATION lib)
endif()
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index e07b5ac..ce714ec 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -104,10 +104,10 @@
string(REGEX REPLACE "[1-9]$" "${DOCUMENTATION_FORMAT}" SOURCE_FILE ${MAN_PAGE})
if(LIBZIP_DO_INSTALL)
if (DOCUMENTATION_FORMAT MATCHES "html")
- install(FILES ${PROJECT_BINARY_DIR}/man/${MAN_PAGE} DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME ${SOURCE_FILE})
+ install(FILES ${PROJECT_BINARY_DIR}/man/${MAN_PAGE} DESTINATION share/doc/${PROJECT_NAME} RENAME ${SOURCE_FILE})
else()
string(REGEX REPLACE ".*(.)$" "man\\1" SUBDIR ${MAN_PAGE})
- install(FILES ${PROJECT_BINARY_DIR}/man/${MAN_PAGE} DESTINATION ${CMAKE_INSTALL_MANDIR}/${SUBDIR})
+ install(FILES ${PROJECT_BINARY_DIR}/man/${MAN_PAGE} DESTINATION man/${SUBDIR})
endif()
endif()
# configure_file does not find out about updates to the sources, and it does not provide a target
@@ -147,9 +147,9 @@
set(TARGET ${CMAKE_MATCH_2})
if(LIBZIP_DO_INSTALL)
if (DOCUMENTATION_FORMAT MATCHES "html")
- INSTALL(FILES ${PROJECT_BINARY_DIR}/man/${SOURCE}.3 DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME ${TARGET}.html)
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/man/${SOURCE}.3 DESTINATION share/doc/${PROJECT_NAME} RENAME ${TARGET}.html)
else()
- INSTALL(FILES ${PROJECT_BINARY_DIR}/man/${SOURCE}.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 RENAME ${TARGET}.3)
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/man/${SOURCE}.3 DESTINATION man/man3 RENAME ${TARGET}.3)
endif()
endif()
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b0060d9..c911110 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,7 +8,7 @@
target_link_libraries(${PROGRAM} zip)
target_include_directories(${PROGRAM} BEFORE PRIVATE ${PROJECT_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR})
if(LIBZIP_DO_INSTALL)
- install(TARGETS ${PROGRAM} EXPORT ${PROJECT_NAME}-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ install(TARGETS ${PROGRAM} EXPORT ${PROJECT_NAME}-targets RUNTIME DESTINATION bin)
endif()
endforeach()
target_link_libraries(zipcmp ${FTS_LIB} ${ZLIB_LIBRARIES})