Skip to content

Commit b6b11ed

Browse files
committed
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/<triplet>/cmake/cpprestsdk instead. Same goes for libraries, support multiarch location if we use UNIX
1 parent b024470 commit b6b11ed

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Release/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ enable_testing()
1818
set(WERROR ON CACHE BOOL "Treat Warnings as Errors.")
1919
set(CPPREST_EXCLUDE_WEBSOCKETS OFF CACHE BOOL "Exclude websockets functionality.")
2020
set(CPPREST_EXCLUDE_COMPRESSION OFF CACHE BOOL "Exclude compression functionality.")
21-
set(CPPREST_EXPORT_DIR lib/cpprestsdk CACHE STRING "Directory to install CMake config files.")
21+
set(CPPREST_EXPORT_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/cpprestsdk CACHE STRING "Directory to install CMake config files.")
2222
set(CPPREST_INSTALL_HEADERS ON CACHE BOOL "Install header files.")
2323
set(CPPREST_INSTALL ON CACHE BOOL "Add install commands.")
2424

@@ -63,6 +63,9 @@ include(cmake/cpprest_find_zlib.cmake)
6363
include(cmake/cpprest_find_openssl.cmake)
6464
include(cmake/cpprest_find_websocketpp.cmake)
6565
include(CheckIncludeFiles)
66+
if(UNIX)
67+
include(GNUInstallDirs)
68+
endif(UNIX)
6669

6770
find_package(Threads REQUIRED)
6871
if(THREADS_HAVE_PTHREAD_ARG)

Release/src/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ if(CPPREST_INSTALL)
250250
install(
251251
TARGETS ${CPPREST_TARGETS}
252252
EXPORT cpprestsdk-targets
253-
RUNTIME DESTINATION bin
254-
LIBRARY DESTINATION lib
255-
ARCHIVE DESTINATION lib
253+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
254+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
255+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
256256
)
257257

258258
configure_file(../cmake/cpprestsdk-config.in.cmake "${CMAKE_CURRENT_BINARY_DIR}/cpprestsdk-config.cmake" @ONLY)

0 commit comments

Comments
 (0)