From f10720ed6974cd26675cfaad359007a991c32600 Mon Sep 17 00:00:00 2001 From: KTGH Date: Sun, 21 Apr 2024 19:14:12 -0400 Subject: [PATCH] Move httplibConf.cmake.in & install readme/license (#1826) * Move httplibConfig.cmake.in to cmake dir Just makes more sense to put it there I suppose. * Cmake install README & License Seems to make sense since you might already do this as a package manager, or an end user might want them anyways. The locations are just based on standard Linux locations using GNUInstallDirs, so it should be sane on other machines too. --- CMakeLists.txt | 7 ++++++- httplibConfig.cmake.in => cmake/httplibConfig.cmake.in | 0 2 files changed, 6 insertions(+), 1 deletion(-) rename httplibConfig.cmake.in => cmake/httplibConfig.cmake.in (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94dcae90d..96d755a26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,7 +245,7 @@ set(_TARGET_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") include(CMakePackageConfigHelpers) # Configures the meta-file httplibConfig.cmake.in to replace variables with paths/values/etc. -configure_package_config_file("${PROJECT_NAME}Config.cmake.in" +configure_package_config_file("cmake/${PROJECT_NAME}Config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" INSTALL_DESTINATION "${_TARGET_INSTALL_CMAKEDIR}" # Passes the includedir install path @@ -293,6 +293,11 @@ if(HTTPLIB_INSTALL) NAMESPACE ${PROJECT_NAME}:: DESTINATION ${_TARGET_INSTALL_CMAKEDIR} ) + + # Install documentation & license + # ex: /usr/share/doc/httplib/README.md and /usr/share/licenses/httplib/LICENSE + install(FILES "README.md" DESTINATION "${CMAKE_INSTALL_DOCDIR}") + install(FILES "LICENSE" DESTINATION "${CMAKE_INSTALL_DATADIR}/licenses/${PROJECT_NAME}") endif() if(HTTPLIB_TEST) diff --git a/httplibConfig.cmake.in b/cmake/httplibConfig.cmake.in similarity index 100% rename from httplibConfig.cmake.in rename to cmake/httplibConfig.cmake.in