From 86a270462ee4f87d6414b965af45d4b0c50d82f1 Mon Sep 17 00:00:00 2001 From: Chris Novakovic Date: Wed, 13 Sep 2023 00:00:45 +0100 Subject: [PATCH] Install documentation under the standard CMake directories Not all Linux and BSD OSes install user documentation and man pages beneath `/usr/share` - use the standard `CMAKE_INSTALL_DOCDIR` and `CMAKE_INSTALL_MANDIR` variables to decide where they should be installed rather than hardcoding `share/` as the prefix. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3202377..600ecce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,8 +187,8 @@ install(TARGETS stubby RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) if (ENABLE_WINDOWS_SERVICE) install(TARGETS stubres LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif () -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/stubby.1 DESTINATION share/man/man1) -install(FILES AUTHORS COPYING ChangeLog NEWS README.md DESTINATION share/doc/stubby) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/stubby.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) +install(FILES AUTHORS COPYING ChangeLog NEWS README.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) # Ensure the file gets CRLF line endings on Windows. file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/stubby.yml INPUT ${CMAKE_CURRENT_SOURCE_DIR}/stubby.yml.example)