From 61290ece847d3dea204c8beec3cc0bc1a03d608a Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 18 Dec 2019 16:34:53 +0100 Subject: [PATCH] Replace hardcoded installation directories with GNUInstallDirs. GNUInstallDirs are portable, many users are familiar with them and they make the life of package maintainers easier. --- CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10b8db82..7ea8b630 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,11 +80,12 @@ target_link_libraries(restclient-cpp PUBLIC Threads::Threads ) -set(INCLUDE_INSTALL_DIR "include/restclient-cpp" ) -set(CONFIG_INSTALL_DIR "lib/cmake/restclient-cpp" ) -set(RUNTIME_INSTALL_DIR "bin" ) -set(LIB_INSTALL_DIR "lib" ) -set(DATA_INSTALL_DIR "share/restclient-cpp" ) +include(GNUInstallDirs) +set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/restclient-cpp" ) +set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/restclient-cpp" ) +set(RUNTIME_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" ) +set(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" ) +set(DATA_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/restclient-cpp" ) install(TARGETS restclient-cpp EXPORT restclient-cppTargets PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}