Browse Source

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.
KTGH 1 year ago
parent
commit
f10720ed69
2 changed files with 6 additions and 1 deletions
  1. 6 1
      CMakeLists.txt
  2. 0 0
      cmake/httplibConfig.cmake.in

+ 6 - 1
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)

+ 0 - 0
httplibConfig.cmake.in → cmake/httplibConfig.cmake.in