-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (36 loc) · 983 Bytes
/
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
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
# For Boost
if (POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif(POLICY CMP0167)
project(http-router)
# Enable C++20 features
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
# Find includes in the build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
endif()
if (APPLE)
set(CMAKE_MACOSX_RPATH 1)
endif()
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /opt/spt)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
find_package(Boost)
if (Boost_FOUND)
add_definitions(-DHAS_BOOST)
message("Boost found, enabling extra features")
include_directories(
${Boost_INCLUDE_DIR}
)
endif()
add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(performance)
add_subdirectory(test)
endif()