From 63cd6d13b540c3651f2314b3214e5d8b254fbeea Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 23 Apr 2018 11:29:02 +0200 Subject: [PATCH] Update CMakeLists.txt to install the cmake bindings in the right location /usr/lib/cpprestsdk is not the correct FHS standard cmake location. It should be placed in /usr/lib//cmake/cpprestsdk instead. Same goes for libraries, support multiarch location if we use UNIX --- Release/CMakeLists.txt | 4 +++- Release/src/CMakeLists.txt | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt index 3e0871c99c..46ff063bbb 100644 --- a/Release/CMakeLists.txt +++ b/Release/CMakeLists.txt @@ -18,7 +18,6 @@ enable_testing() set(WERROR ON CACHE BOOL "Treat Warnings as Errors.") set(CPPREST_EXCLUDE_WEBSOCKETS OFF CACHE BOOL "Exclude websockets functionality.") set(CPPREST_EXCLUDE_COMPRESSION OFF CACHE BOOL "Exclude compression functionality.") -set(CPPREST_EXPORT_DIR lib/cpprestsdk CACHE STRING "Directory to install CMake config files.") set(CPPREST_INSTALL_HEADERS ON CACHE BOOL "Install header files.") set(CPPREST_INSTALL ON CACHE BOOL "Add install commands.") @@ -63,6 +62,9 @@ include(cmake/cpprest_find_zlib.cmake) include(cmake/cpprest_find_openssl.cmake) include(cmake/cpprest_find_websocketpp.cmake) include(CheckIncludeFiles) +if(UNIX) +include(GNUInstallDirs) +endif(UNIX) find_package(Threads REQUIRED) if(THREADS_HAVE_PTHREAD_ARG) diff --git a/Release/src/CMakeLists.txt b/Release/src/CMakeLists.txt index a37a8cff9d..348916ae2a 100644 --- a/Release/src/CMakeLists.txt +++ b/Release/src/CMakeLists.txt @@ -250,21 +250,21 @@ if(CPPREST_INSTALL) install( TARGETS ${CPPREST_TARGETS} EXPORT cpprestsdk-targets - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) configure_file(../cmake/cpprestsdk-config.in.cmake "${CMAKE_CURRENT_BINARY_DIR}/cpprestsdk-config.cmake" @ONLY) install( FILES "${CMAKE_CURRENT_BINARY_DIR}/cpprestsdk-config.cmake" - DESTINATION ${CPPREST_EXPORT_DIR} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake ) install( EXPORT cpprestsdk-targets FILE cpprestsdk-targets.cmake NAMESPACE cpprestsdk:: - DESTINATION ${CPPREST_EXPORT_DIR} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake ) endif()