-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
89 lines (67 loc) · 1.82 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
cmake_minimum_required(VERSION 3.16)
project(Palantir)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
add_executable(Palantir
src/palantir.hpp
src/cache.cpp
src/dispatcher.cpp
src/scraper.cpp
src/net.cpp
src/main.cpp)
target_include_directories(Palantir
PRIVATE
include)
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
include(FetchContent)
find_package(PkgConfig REQUIRED)
find_package(OpenSSL REQUIRED)
FetchContent_Declare(
zlib
GIT_REPOSITORY https://github.com/madler/zlib.git
GIT_TAG cacf7f1d4e3d44d871b605da3b647f07d718623f
)
FetchContent_Declare(
hiredis
GIT_REPOSITORY https://github.com/redis/hiredis.git
GIT_TAG 8a15f4d6578560f2a375c32fc567c4c88335c2a8
)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG b6f4ceaed0a0a24ccf575fab6c56dd50ccf6f1a9
)
FetchContent_Declare(
pugixml
GIT_REPOSITORY https://github.com/zeux/pugixml.git
GIT_TAG dd50fa5b45ab8d58d6c27566c2eaf04a8b7e5841
)
FetchContent_MakeAvailable(
zlib
hiredis
fmt
pugixml
)
add_library(PalantirLib
INTERFACE)
target_link_libraries(PalantirLib
INTERFACE
OpenSSL::SSL OpenSSL::Crypto
libz.a
hiredis_static
pugixml
fmt
)
target_link_libraries(
Palantir
PalantirLib
)
endif()
enable_testing ()
add_subdirectory (tests)