-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
54 lines (41 loc) · 1.25 KB
/
CMakeLists.txt
File metadata and controls
54 lines (41 loc) · 1.25 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
cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
project(honesty
VERSION 0.1.0
DESCRIPTION "Honesty"
LANGUAGES CXX
)
option(BUILD_TESTING "Build the tests verifying Honesty functionality" ON)
# Provide the library definition
add_library(honesty STATIC)
add_library(synodic::honesty ALIAS honesty)
# Provide a convenience variant with a main function
add_library(honesty_main STATIC)
add_library(synodic::honesty::main ALIAS honesty_main)
set_target_properties(honesty honesty_main
PROPERTIES
LINKER_LANGUAGE CXX
CXX_STANDARD 23
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS NO
FOLDER "honesty"
)
# Link the library to the convenience variant
target_link_libraries(honesty_main
PUBLIC
synodic::honesty
)
# Gather all the project files
add_subdirectory(
src
)
# Glob all files to add a source group tree. Includes all files
file(GLOB_RECURSE file_list ${CMAKE_CURRENT_SOURCE_DIR}/src/*)
# Must be called from the target definition directory. Only matched against target source files (No nested CMakeList.txt, docs, etc).
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src FILES ${file_list})
if(BUILD_TESTING)
# Do not include CTest because it adds targets and integrations we do not want to support
enable_testing()
add_subdirectory(
tests
)
endif()