-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
90 lines (71 loc) · 2.11 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
84
85
86
87
88
89
# Copyright (c) 2023 Hartmut Kaiser
#
# SPDX-License-Identifier: BSL-1.0
# 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.19)
set(CHPLX_MAJOR_VERSION 0)
set(CHPLX_MINOR_VERSION 1)
set(CHPLX_PATCH_VERSION 0)
set(CHPLX_BUILD_VERSION 0)
set(CHPLX_DEVELOPER ON)
set(CHPLX_OFFICIAL_RELEASE 0)
set(CHPLX_VERSION
${CHPLX_MAJOR_VERSION}.${CHPLX_MINOR_VERSION}.${CHPLX_PATCH_VERSION}.${CHPLX_BUILD_VERSION}
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS_INIT "-std=c++20")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE
"Debug"
CACHE
STRING
"Configuration type (one of Debug, RelWithDebInfo, Release, MinSizeRel)"
FORCE
)
endif()
project(chplx VERSION ${CHPLX_VERSION})
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_compile_definitions(
$<$<BOOL:${MSVC}>:_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING>
)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
include(CHPLX_Utils)
# ##############################################################################
# build options
if(WIN32)
set(CHPLX_WITH_PSEUDO_DEPENDENCIES_DEFAULT OFF)
else()
set(CHPLX_WITH_PSEUDO_DEPENDENCIES_DEFAULT ON)
endif()
chplx_option(
CHPLX_WITH_EXAMPLES BOOL "Enable building examples (default: ON)" ON ADVANCED
)
chplx_option(
CHPLX_WITH_TESTS BOOL "Enable building tests (default: ON)" ON ADVANCED
)
chplx_option(
CHPLX_WITH_PSEUDO_DEPENDENCIES
BOOL
"Enable build pseudo target (default: ${CHPLX_WITH_PSEUDO_DEPENDENCIES_DEFAULT})"
${CHPLX_WITH_PSEUDO_DEPENDENCIES_DEFAULT}
ADVANCED
)
chplx_option(
CHPLX_WITH_PARALLEL_TESTS_BIND_NONE
BOOL
"Pass --hpx:bind=none to tests that may run in parallel (cmake -j flag) (default: OFF)"
OFF
CATEGORY "Debugging"
ADVANCED
)
add_chplx_pseudo_target(tests)
add_chplx_pseudo_target(tests.unit)
add_chplx_pseudo_dependencies(tests tests.unit)
if(CHPLX_WITH_TESTS)
enable_testing()
include(CTest)
endif()
add_subdirectory(frontend)
add_subdirectory(backend)
add_subdirectory(library)