-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
22 lines (19 loc) · 1013 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
cmake_minimum_required(VERSION 3.10)
project(BitTorrent)
set(CMAKE_CXX_STANDARD 20)
set(common_flags -fdiagnostics-color=always -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -Wcast-align -Wold-style-cast -Wunused -Wunused-variable -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wmisleading-indentation -Wnull-dereference -Wdouble-promotion -Wformat=2)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(${common_flags} -fcolor-diagnostics)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(${common_flags} -Wuseless-cast -Wlogical-op -Wduplicated-branches -Wduplicated-cond)
endif()
find_package(Boost 1.78.0 REQUIRED)
find_package(Boost REQUIRED COMPONENTS unit_test_framework filesystem)
include(cmake/CPM.cmake)
CPMAddPackage("gh:boostorg/uuid#boost-1.78.0")
CPMAddPackage("gh:boostorg/variant#boost-1.78.0")
CPMAddPackage("gh:gabime/[email protected]")
CPMAddPackage("gh:eranpeer/FakeIt#2.0.9")
enable_testing()
add_subdirectory(src)
add_subdirectory(test)