-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
76 lines (64 loc) · 1.87 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
cmake_minimum_required(VERSION 3.27)
project(tfc-framework
VERSION
"2024.7.1"
DESCRIPTION
"The tfc framework eases the integration of often used components in different context with mappable IPC and config."
HOMEPAGE_URL
https://skaginn3x.github.io/framework/
LANGUAGES
CXX
)
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
include(CTest)
# Add the cmake folder so the FindSphinx module is found
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/findModules")
include(tfc_options)
include(tfc_config)
include(tfc_warnings)
include(tfc_docs)
include(tfc_cpack)
set(PACKAGE_NAME ${PROJECT_NAME})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(PACKAGE_NAME "${PACKAGE_NAME}-dbg")
endif()
tfc_cpack_init(${PACKAGE_NAME} ${CMAKE_CURRENT_LIST_DIR}/LICENSE ${CMAKE_CURRENT_LIST_DIR}/readme.md)
if (BUILD_EXES)
add_subdirectory(exes)
endif()
add_subdirectory(libs)
if (BUILD_DOCS)
add_subdirectory(docs)
endif()
if (BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
# Clang format all files
file(GLOB_RECURSE ALL_SOURCE_FILES libs/**/*.cpp libs/**/*.hpp exes/**/*.cpp exes/**/*.hpp)
add_custom_target(
clangformat-fix
COMMAND clang-format
--style=file
-i
${ALL_SOURCE_FILES}
)
add_custom_target(
clangformat-dry
COMMAND clang-format
--style=file
-i
--dry-run
${ALL_SOURCE_FILES}
)
# from https://stackoverflow.com/questions/18968979/how-to-make-colorized-message-with-cmake
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
message("${Green}Using ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} for ${CMAKE_SYSTEM_PROCESSOR}${ColourReset}")
message("${Green}Library path: $ENV{LIBRARY_PATH}${ColourReset}")
message("${Green}Build type: ${CMAKE_BUILD_TYPE}${ColourReset}")
feature_summary(
DESCRIPTION "A summary of TFC options"
WHAT ALL
)