-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (59 loc) · 2.26 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
#
# Copyright 2018 Gerard Choinka
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or
# copy at http://www.boost.org/LICENSE_1_0.txt)
#
cmake_minimum_required(VERSION 3.12.1)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.44.tar.gz"
SHA1 "c4cfcc0cd39fdae8de08f6205b7f34cab4a7ba79"
)
project(gpm VERSION 0.1.0 LANGUAGES CXX)
include("cmake/CompilerSettings.cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(GPM_BUILD_TESTS "Enable to build the tests" ON)
option(GPM_BUILD_EXAMPLES "Enable to build the tests" ON) # TODO split EXAMPLES and BENCHMARK
option(GPM_BUILD_BENCHMARK "Enable to build benchmarks" ON)
option(GPM_BUILD_SKETCH "Enable to build sketch" OFF)
option(GPM_CXX_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
option(GPM_BUILD_WPROFILER "Enable to build with profiler (search for depandencies in system libgoogle-perftools-dev)" OFF)
hunter_add_package(Boost COMPONENTS program_options)
set(BOOST_MIN_VERSION "1.68.0")
find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS program_options REQUIRED)
hunter_add_package(fmt)
find_package(fmt CONFIG REQUIRED)
hunter_add_package(spdlog)
find_package(spdlog CONFIG REQUIRED)
if(${GPM_BUILD_TESTS})
hunter_add_package(Catch)
find_package(Catch2 CONFIG REQUIRED)
enable_testing()
endif()
if(${GPM_BUILD_BENCHMARK})
hunter_add_package(benchmark)
find_package(benchmark CONFIG REQUIRED)
endif()
if(${GPM_BUILD_WPROFILER})
find_package(Gperftools REQUIRED)
endif()
find_package(ClangFormat)
find_package(Threads)
add_library(Outcome INTERFACE)
target_include_directories(Outcome SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/ned14_outcome/include)
add_library(Gpm INTERFACE)
target_include_directories(Gpm INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(Gpm INTERFACE Boost::boost)
add_library(Frozen INTERFACE)
target_include_directories(Frozen INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/frozen/include)
if(${GPM_BUILD_TESTS})
add_subdirectory(tests)
endif()
if(${GPM_BUILD_EXAMPLES})
add_subdirectory(examples)
endif()
if(${GPM_BUILD_SKETCH})
add_subdirectory(sketch)
endif()