-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (38 loc) · 1.35 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.14)
project(proxy-sr)
set(CMAKE_CXX_STANDARD 17)
set(SOURCES src/helper.cpp src/proxy.cpp)
set(TEST_SOURCES src/helper.cpp tests/helper_test.cpp)
include(FetchContent)
# GTest
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
# Poco
# FetchContent_Declare(
# poco
# GIT_REPOSITORY "https://github.com/pocoproject/poco.git"
# GIT_TAG "poco-1.10.0-release"
# )
# FetchContent_MakeAvailable(poco)
find_package(OpenSSL REQUIRED)
find_package(Threads REQUIRED)
enable_testing()
include_directories(include)
add_executable(proxy-sr ${SOURCES} src/main.cpp)
target_include_directories(proxy-sr PRIVATE include)
target_link_libraries(proxy-sr OpenSSL::SSL)
target_link_libraries(proxy-sr OpenSSL::Crypto)
target_link_libraries(proxy-sr Threads::Threads)
# TESTS
add_executable(proxy-sr_tests ${TEST_SOURCES})
target_link_libraries(proxy-sr_tests gtest_main)
# target_link_libraries(proxy-sr_tests OpenSSL::SSL)
# target_link_libraries(proxy-sr_tests OpenSSL::Crypto)
# target_link_libraries(proxy-sr_tests Threads::Threads)
include(GoogleTest)
gtest_discover_tests(proxy-sr_tests)