-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
49 lines (39 loc) · 1.79 KB
/
CMakeLists.txt
File metadata and controls
49 lines (39 loc) · 1.79 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
cmake_minimum_required(VERSION ${CMAKE_VERSION}) #VERSION 3.12)
project(Nettverksprog_prosjekt)
find_path(EVENT_INCLUDE_DIR event.h
PATHS /usr/include/x86_64-linux-gnu
PATH_SUFFIXES event2)
find_library(EVENT_LIBRARY
NAMES event
PATHS /usr/lib/x86_64-linux-gnu)
set(EVENT_LIBRARIES ${EVENT_LIBRARY} )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EVENT
DEFAULT_MSG
EVENT_INCLUDE_DIR
EVENT_LIBRARIES
)
find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h")
find_library(NGHTTP2_LIBRARY NAMES nghttp2)
find_package_handle_standard_args(NGHTTP2
FOUND_VAR
NGHTTP2_FOUND
REQUIRED_VARS
NGHTTP2_LIBRARY
NGHTTP2_INCLUDE_DIR
FAIL_MESSAGE
"Could NOT find NGHTTP2"
)
set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
set(NGHTTP2_LIBRARIES ${NGHTTP2_LIBRARY})
find_package(Boost) #1.68.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wall -Wextra -Wno-unused-parameter")
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
add_executable(HTTP-2-lib-server main.cpp src/h2_server.cpp src/h2_callbacks.cpp src/h2_utils.cpp src/h2_frame_handlers.cpp src/h2_config.cpp src/h2_structs.hpp src/h2_enums.hpp)
target_link_libraries(HTTP-2-lib-server ${OPENSSL_LIBRARIES} -levent_openssl -levent ${EVENT_LIBRARIES} ${NGHTTP2_LIBRARIES})
include_directories(${Boost_INCLUDE_DIR})
add_executable(Tests test/main.test.cpp test/h2_utils.test.cpp test/h2_server.test.cpp src/h2_server.cpp src/h2_callbacks.cpp src/h2_utils.cpp src/h2_frame_handlers.cpp
src/h2_config.cpp src/h2_structs.hpp src/h2_enums.hpp)
target_link_libraries(Tests ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} -levent_openssl -levent ${EVENT_LIBRARIES} ${NGHTTP2_LIBRARIES})