-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (35 loc) · 1.15 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
cmake_minimum_required(VERSION 3.05)
project(HPACK LANGUAGES CXX)
### options ###
option(HPACK_ENABLE_TESTING "enables testing" OFF)
option(HPACK_USE_CPM "turn off to not download boost" ON)
### dependecies ###
if(HPACK_USE_CPM)
include(cmake/get_cpm.cmake)
set(BOOST_INCLUDE_LIBRARIES intrusive)
CPMAddPackage(
NAME Boost
VERSION 1.84.0
URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.xz
OPTIONS "BOOST_ENABLE_CMAKE ON"
)
unset(BOOST_INCLUDE_LIBRARIES)
find_package(Boost 1.84 COMPONENTS intrusive REQUIRED)
endif()
### hpacklib ###
add_library(hpacklib STATIC
"${CMAKE_CURRENT_SOURCE_DIR}/src/decoder.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/dynamic_table.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/huffman.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/static_table.cpp")
target_include_directories(hpacklib PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(hpacklib PUBLIC Boost::intrusive)
set_target_properties(hpacklib PROPERTIES
CMAKE_CXX_EXTENSIONS OFF
LINKER_LANGUAGE CXX
CMAKE_CXX_STANDARD_REQUIRED ON
CXX_STANDARD 20)
if(HPACK_ENABLE_TESTING)
include(CTest)
add_subdirectory(tests)
endif()