-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
30 lines (24 loc) · 965 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
cmake_minimum_required(VERSION 3.10)
project(HttpClient_beast)
set(CMAKE_CXX_STANDARD 14)
find_package(OpenSSL)
# Download boost 1.7
if (NOT EXISTS ${CMAKE_BINARY_DIR}/boost_1_70_0)
file(DOWNLOAD
https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.zip
${CMAKE_BINARY_DIR}/boost_1_70_0.zip
SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar "xf" ${CMAKE_BINARY_DIR}/boost_1_70_0.zip)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/boost_1_70_0.zip)
endif ()
add_library(HttpClient HttpClient)
target_include_directories(HttpClient PRIVATE
${CMAKE_BINARY_DIR}/boost_1_70_0)
target_link_libraries(HttpClient
pthread
OpenSSL::SSL
OpenSSL::Crypto)
add_executable(test_httpclient main_beast)
target_include_directories(test_httpclient PRIVATE
${CMAKE_BINARY_DIR}/boost_1_70_0)
target_link_libraries(test_httpclient HttpClient)