-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
78 lines (64 loc) · 2.16 KB
/
CMakeLists.txt
File metadata and controls
78 lines (64 loc) · 2.16 KB
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
# Copyright (C) 2026 Raven Computing
# Reckon: A Tool to Count Logical Lines of Code
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
project(
reckon
VERSION 1.5.0
DESCRIPTION "A Tool to Count Logical Lines of Code"
HOMEPAGE_URL "https://github.com/raven-computing/reckon"
LANGUAGES "C"
)
option(RECKON_BUILD_TESTS "Enable/disable tests" OFF)
option(
RECKON_IGNORE_WARNINGS
"Specifies whether compiler warnings should let the build \
process fail (OFF) or whether they should be ignored (ON)"
OFF
)
option(RECKON_BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(RECKON_BUILD_ONLY_LIBS "Build only the Reckon libraries" OFF)
option(RECKON_USE_SANITIZERS "Enable/disable the use of sanitizers" OFF)
option(RECKON_ENABLE_LTO "Enable/disable link-time optimization (LTO)" ON)
option(
RECKON_BUILD_TEST_COVERAGE
"Enable/disable test coverage instrumentation"
OFF
)
option(
RECKON_SOURCE_ANALYSIS
"Enable/disable source code static analysis by the compiler"
OFF
)
set(RECKON_C_STANDARD 17 CACHE STRING "The C standard to use for targets")
if(EXISTS "${PROJECT_SOURCE_DIR}/.cmakeprefixpath")
message(STATUS "Setting CMake prefix path")
file(READ ".cmakeprefixpath" _VAR_CMAKE_PREFIX_PATH)
list(APPEND CMAKE_PREFIX_PATH ${_VAR_CMAKE_PREFIX_PATH})
endif()
if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION")
file(READ "${PROJECT_SOURCE_DIR}/VERSION" RECKON_VERSION)
endif()
include(cmake/BuildUtil.cmake)
include(cmake/TestUtil.cmake)
include(cmake/TestCoverageUtil.cmake)
include(cmake/SanitizerUtil.cmake)
if(NOT DEFINED RECKON_DO_NOT_OVERWRITE_OUTPUT_DIRECTORY)
set_output_directories()
endif()
if(RECKON_ENABLE_LTO)
set_link_time_optimization(ON)
endif()
include(Dependencies.cmake)
add_subdirectory(src/lib lib)
if(NOT RECKON_BUILD_ONLY_LIBS)
add_subdirectory(src/scount scount)
endif()
if(RECKON_BUILD_TEST_COVERAGE)
add_code_coverage_collection_targets()
endif()
if(NOT RECKON_BUILD_ONLY_LIBS)
include(cmake/ReckonInstallation.cmake)
set(RECKON_INSTALL_COMPONENT "reckon_scount")
setup_scount_installation(${RECKON_INSTALL_COMPONENT})
setup_scount_packaging(${RECKON_INSTALL_COMPONENT})
endif()