2021-03-26 23:18:51 +01:00
|
|
|
# Create the CPR library
|
|
|
|
add_library(CPR STATIC
|
|
|
|
# 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
|
2021-07-02 16:44:48 +02:00
|
|
|
cpr/proxyauth.cpp
|
2021-03-26 23:18:51 +01:00
|
|
|
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
|
2021-07-02 16:44:48 +02:00
|
|
|
include/cpr/proxyauth.h
|
2021-03-26 23:18:51 +01:00
|
|
|
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
|
|
|
|
)
|
|
|
|
# Library includes
|
|
|
|
target_include_directories(CPR PRIVATE ${CMAKE_CURRENT_LIST_DIR}/cpr)
|
|
|
|
target_include_directories(CPR PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
|
|
|
|
# Find CURK
|
2021-03-31 16:32:41 +02:00
|
|
|
find_package(CURL REQUIRED)
|
2021-03-26 23:18:51 +01:00
|
|
|
if (CURL_FOUND)
|
|
|
|
set(SSL_ENABLED ON CACHE INTERNAL "" FORCE)
|
|
|
|
else()
|
2021-03-31 16:32:41 +02:00
|
|
|
message(FATAL_ERROR "Unable to find CURL library.")
|
2021-03-26 23:18:51 +01:00
|
|
|
endif()
|
|
|
|
# Link to CURL
|
|
|
|
target_link_libraries(CPR PUBLIC curl)
|