diff --git a/vendor/CPR/CMakeLists.txt b/vendor/CPR/CMakeLists.txt index 2e72fa01..1b2a9163 100644 --- a/vendor/CPR/CMakeLists.txt +++ b/vendor/CPR/CMakeLists.txt @@ -195,8 +195,68 @@ if(BUILD_CPR_TESTS) endif() ]] -add_subdirectory(cpr) -add_subdirectory(include) +add_library(cpr + # Source files + cpr/auth.cpp + cpr/bearer.cpp + cpr/cookies.cpp + cpr/cprtypes.cpp + cpr/curl_container.cpp + cpr/curlholder.cpp + cpr/error.cpp + cpr/multipart.cpp + cpr/parameters.cpp + cpr/payload.cpp + cpr/proxies.cpp + cpr/session.cpp + cpr/timeout.cpp + cpr/unix_socket.cpp + cpr/util.cpp + cpr/response.cpp + # Header files + include/cpr/api.h + include/cpr/auth.h + include/cpr/bearer.h + include/cpr/body.h + include/cpr/cookies.h + include/cpr/cpr.h + include/cpr/cprtypes.h + include/cpr/curlholder.h + include/cpr/curlholder.h + include/cpr/digest.h + include/cpr/error.h + include/cpr/limit_rate.h + include/cpr/max_redirects.h + include/cpr/multipart.h + include/cpr/ntlm.h + include/cpr/parameters.h + include/cpr/payload.h + include/cpr/proxies.h + include/cpr/response.h + include/cpr/session.h + include/cpr/ssl_options.h + include/cpr/timeout.h + include/cpr/unix_socket.h + include/cpr/util.h + include/cpr/verbose.h +) + +add_library(cpr::cpr ALIAS cpr) + +target_include_directories(cpr PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(cpr PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) + +target_link_libraries(cpr PUBLIC CURL::libcurl) # todo should be private, but first dependencies in ssl_options need to be removed + +# Set version for shared libraries. +set_target_properties(cpr + PROPERTIES + VERSION ${${PROJECT_NAME}_VERSION} + SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR}) + +install(DIRECTORY cpr DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +install(TARGETS cpr) #[[ if(BUILD_CPR_TESTS) diff --git a/vendor/CPR/cpr/CMakeLists.txt b/vendor/CPR/cpr/CMakeLists.txt deleted file mode 100644 index a75372e2..00000000 --- a/vendor/CPR/cpr/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -cmake_minimum_required(VERSION 3.7) - -add_library(cpr - auth.cpp - bearer.cpp - cookies.cpp - cprtypes.cpp - curl_container.cpp - curlholder.cpp - error.cpp - multipart.cpp - parameters.cpp - payload.cpp - proxies.cpp - session.cpp - timeout.cpp - unix_socket.cpp - util.cpp - response.cpp - ) - -add_library(cpr::cpr ALIAS cpr) - -target_link_libraries(cpr PUBLIC CURL::libcurl) # todo should be private, but first dependencys in ssl_options need to be removed - -# Set version for shared libraries. -set_target_properties(cpr - PROPERTIES - VERSION ${${PROJECT_NAME}_VERSION} - SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR}) - -install(TARGETS cpr) diff --git a/vendor/CPR/include/CMakeLists.txt b/vendor/CPR/include/CMakeLists.txt deleted file mode 100644 index b6957081..00000000 --- a/vendor/CPR/include/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -cmake_minimum_required(VERSION 3.7) - -target_include_directories(cpr PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) - -target_sources(cpr PRIVATE - # Header files (useful in IDEs) - cpr/api.h - cpr/auth.h - cpr/bearer.h - cpr/body.h - cpr/cookies.h - cpr/cpr.h - cpr/cprtypes.h - cpr/curlholder.h - cpr/curlholder.h - cpr/digest.h - cpr/error.h - cpr/limit_rate.h - cpr/max_redirects.h - cpr/multipart.h - cpr/ntlm.h - cpr/parameters.h - cpr/payload.h - cpr/proxies.h - cpr/response.h - cpr/session.h - cpr/ssl_options.h - cpr/timeout.h - cpr/unix_socket.h - cpr/util.h - cpr/verbose.h -) - -install(DIRECTORY cpr DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})