Skip to content

Commit

Permalink
Update CMakeLists.txt to install the cmake bindings in the right loca…
Browse files Browse the repository at this point in the history
…tion

/usr/lib/cpprestsdk is not the correct FHS standard cmake location.
It should be placed in /usr/lib/<triplet>/cmake/cpprestsdk instead.

Same goes for libraries, support multiarch location if we use UNIX
  • Loading branch information
LocutusOfBorg committed Apr 23, 2018
1 parent b024470 commit b6b11ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Release/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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_EXPORT_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/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.")

Expand Down Expand Up @@ -63,6 +63,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)
Expand Down
6 changes: 3 additions & 3 deletions Release/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ 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)
Expand Down

0 comments on commit b6b11ed

Please sign in to comment.