-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (43 loc) · 1.19 KB
/
CMakeLists.txt
File metadata and controls
52 lines (43 loc) · 1.19 KB
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
52
cmake_minimum_required(VERSION 3.31.6)
project(s3cpp LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# GoogleTest
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/6ec14dfd8c409d05fba94e18e3a02df35b874353.zip
)
FetchContent_MakeAvailable(googletest)
# cURL
find_package(CURL REQUIRED)
# OpenSSL (SHA256)
find_package(OpenSSL REQUIRED)
add_library(s3cpplib STATIC
src/s3cpp/httpclient.cpp
src/s3cpp/auth.cpp
src/s3cpp/xml.hpp
src/s3cpp/types.h
src/s3cpp/s3.cpp
)
target_include_directories(s3cpplib PUBLIC src)
target_link_libraries(s3cpplib PUBLIC CURL::libcurl OpenSSL::Crypto)
set_target_properties(s3cpplib PROPERTIES
OUTPUT_NAME "s3cpp"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
add_executable(s3cpp_app main.cpp)
target_link_libraries(s3cpp_app s3cpplib)
# Testing
enable_testing()
add_executable(tests
test/httpclient_test.cpp
test/auth_test.cpp
test/xml_test.cpp
test/s3_test.cpp
test/aws_test.cpp
)
target_link_libraries(tests s3cpplib GTest::gtest_main GTest::gmock_main CURL::libcurl OpenSSL::Crypto)
include(GoogleTest)
gtest_discover_tests(tests)