-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (49 loc) · 1.81 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
# SPDX-FileCopyrightText: 2021 Eduardo Robles <[email protected]>
#
# SPDX-License-Identifier: AGPL-3.0-only
cmake_minimum_required(VERSION 3.14)
# Project name and a few useful settings. Other commands can pick up the results
project(
BallotVerifier
VERSION 4.0.2
DESCRIPTION "cast-as-intended verifier for Sequent platform"
LANGUAGES CXX)
set(CMAKE_FORMAT_EXCLUDE "(cmake/.*|_deps/.*|cpm-package-lock\.cmake|CMakeLists.txt)")
set(FORMAT_SKIP_CMAKE "NO")
add_subdirectory(Format.cmake)
# GoogleTest requires at least C++11
set(CMAKE_CXX_STANDARD 11)
# Disable response files, not compatible with clang-tidy. See:
# https://stackoverflow.com/a/69394586
# set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES Off)
# Code Quality: Enable all the compiler warnings and ensure to error on
# warnings.
add_compile_options(-Wall -Wextra -Wpedantic -Werror -DNDEBUG)
# allow our custom cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
# set the output directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/out")
# Only do these if this is the main project, and not if it is included through
# add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Let's nicely support folders in IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
option(FORCE_COLORED_OUTPUT
"Always produce ANSI-colored output (GNU/Clang only)." TRUE)
if(${FORCE_COLORED_OUTPUT})
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-fdiagnostics-color=always)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options(-fcolor-diagnostics)
endif()
endif()
# The compiled library code is here
add_subdirectory(src)
# The executable code is here
add_subdirectory(apps)
include(CTest)
enable_testing()
if(BUILD_TESTING)
add_subdirectory(tests)
endif()