-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
122 lines (103 loc) · 3.71 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
cmake_minimum_required(VERSION 3.28)
find_program(CCACHE_EXECUTABLE ccache)
if (CCACHE_PROGRAM)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
endif()
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF)
project(WorkHorz VERSION 0.0.1 DESCRIPTION "WorkHorz" LANGUAGES CXX)
find_package(OpenSSL CONFIG REQUIRED)
find_package(boost_asio REQUIRED CONFIG)
find_package(boost_locale REQUIRED CONFIG)
find_package(simdutf REQUIRED CONFIG)
find_package(fmt CONFIG REQUIRED)
find_package(simdjson CONFIG REQUIRED)
find_package(Catch2 CONFIG REQUIRED)
find_package(lua REQUIRED)
find_package(sol2 CONFIG REQUIRED)
find_package(Taskflow CONFIG REQUIRED)
find_package(CLI11 CONFIG REQUIRED)
find_package(ftxui CONFIG REQUIRED)
find_package(unofficial-sodium CONFIG REQUIRED) # for libsodium
find_package(libzip CONFIG REQUIRED)
find_package(liblzma CONFIG REQUIRED)
find_path(QUILL_INCLUDE_DIRS "quill/Backend.h" "quill/Frontend.h" "quill/LogMacros.h" "quill/whz_logger.h" "quill/sinks/ConsoleSink.h")
add_subdirectory(external/bustache)
add_executable(whz-core src/whz-core.cpp
src/whz_common.cpp
src/whz_connection.cpp
src/whz_io_context_pool.cpp
src/whz_ssl_connection.cpp
src/whz_request.cpp
src/whz_request_handler.cpp
src/whz_request_parser.cpp
src/whz_server.cpp
src/whz_utils.cpp
src/whz_resources.cpp
src/whz_config.cpp
src/whz_http_routing.cpp
src/whz_LUA_core.cpp
src/whz_LUA_api.cpp
src/whz_renderer.cpp
src/whz_templateCache.cpp
src/whz_quill_wrapper.cpp
src/LocalizationManager.cpp
src/whz_encryption.cpp
src/whz_template_parser.cpp
src/whz_datacompression.cpp
)
# set_property(TARGET whz-core PROPERTY CXX_STANDARD 23)
find_path(QUILL_INCLUDE_DIRS "quill/Backend.h")
find_path(RANG_INCLUDE_DIRS "rang.hpp")
find_path(RAPIDHASH_INCLUDE_DIRS "rapidhash.h")
target_include_directories(whz-core PRIVATE ${QUILL_INCLUDE_DIRS})
target_include_directories(whz-core PRIVATE ${RANG_INCLUDE_DIRS})
target_include_directories(whz-core PRIVATE ${LUA_INCLUDE_DIRS})
target_include_directories(whz-core PRIVATE ${RAPIDHASH_INCLUDE_DIRS})
target_link_libraries(whz-core PRIVATE
Boost::asio
fmt::fmt
OpenSSL::SSL
OpenSSL::Crypto
simdjson::simdjson
Catch2::Catch2 Catch2::Catch2WithMain
Taskflow::Taskflow
sol2
${LUA_LIBRARIES}
CLI11::CLI11
fmt::fmt
ftxui::dom ftxui::screen ftxui::component
simdutf::simdutf
Boost::locale
unofficial-sodium::sodium
bustache::bustache
libzip::zip
liblzma::liblzma
)
if (BUILD_TESTING)
message("Building tests")
include(CTest)
include(Catch)
add_executable(sample_tests tests/factorial.cpp)
target_link_libraries(sample_tests PRIVATE Catch2::Catch2 Catch2::Catch2WithMain)
catch_discover_tests(sample_tests)
endif ()
if (BUILD_DOC)
find_package(Doxygen)
if (DOXYGEN_FOUND)
set(abs_top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
set(abs_top_builddir ${CMAKE_CURRENT_BINARY_DIR})
message(${CMAKE_CURRENT_SOURCE_DIR})
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
add_custom_target(doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
else (DOXYGEN_FOUND)
message("Doxygen needs to be installed to generate doxygen documentation")
endif (DOXYGEN_FOUND)
endif()