-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
126 lines (94 loc) · 4.2 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
###########################################################
# _______ ______ ______ #
# | \ / \ / \ #
# __ __ ______ ______ | ▓▓▓▓▓▓▓\ ▓▓▓▓▓▓\ ▓▓▓▓▓▓\ #
# | \ | \| \ / \| ▓▓ | ▓▓ ▓▓__| ▓▓ ▓▓ | ▓▓ #
# | ▓▓ | ▓▓ \▓▓▓▓▓▓\ ▓▓▓▓▓▓\ ▓▓ | ▓▓ ▓▓ ▓▓ ▓▓ | ▓▓ #
# | ▓▓ | ▓▓/ ▓▓ ▓▓ | ▓▓ ▓▓ | ▓▓ ▓▓▓▓▓▓▓▓ ▓▓ _| ▓▓ #
# | ▓▓__/ ▓▓ ▓▓▓▓▓▓▓ ▓▓__/ ▓▓ ▓▓__/ ▓▓ ▓▓ | ▓▓ ▓▓/ \ ▓▓ #
# \▓▓ ▓▓\▓▓ ▓▓\▓▓ ▓▓ ▓▓ ▓▓ ▓▓ | ▓▓\▓▓ ▓▓ ▓▓ #
# _\▓▓▓▓▓▓▓ \▓▓▓▓▓▓▓ \▓▓▓▓▓▓ \▓▓▓▓▓▓▓ \▓▓ \▓▓ \▓▓▓▓▓▓\ #
# | \__| ▓▓ \▓▓▓ #
# \▓▓ ▓▓ #
# \▓▓▓▓▓▓ #
# #
###########################################################
cmake_minimum_required(VERSION 3.16...${CMAKE_VERSION})
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/external")
# Load Setting to be able to change the options etc.
include("${CMAKE_CURRENT_SOURCE_DIR}/Settings.cmake")
include(GetCMakeMM)
cmmm(VERSION "2.3" REPOSITORY "flagarde/CMakeMM" PROVIDER "github" VERBOSITY VERBOSE)
cmmm_modules_list(REPOSITORY "flagarde/CMakeCM" PROVIDER "github")
project(YAODAQ VERSION "0.0.1.0" DESCRIPTION "Yet An Other DAQ" HOMEPAGE_URL "https://github.com/flagarde/YAODAQ" LANGUAGES CXX)
include(PreventInSourceBuilds)
prevent_in_source_builds()
include(DefaultInstallPrefix)
default_install_prefix("${CMAKE_SOURCE_DIR}/bin")
include(Standards)
cxx_17()
c_11()
include(GNUInstallDirs)
set(DEFAULT_YAODAQ_CONFIGS_PATH "${CMAKE_INSTALL_PREFIX}/configs")
set(DEFAULT_YAODAQ_PLUGINS_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/plugins")
set(DEFAULT_YAODAQ_DATA_PATH "${CMAKE_INSTALL_PREFIX}/data")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#include(DefaultConfigurations)
#include(ConfigurationCheck)
#set_default_configuration("Debug")
#include(Formatters)
# Ask CMake to output a compile_commands.json file for use with things like Vim YCM.
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set(CMAKE_LINK_DEPENDS_NO_SHARED TRUE)
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
link_directories("${CMAKE_INSTALL_FULL_LIBDIR}")
# If we want to have test in the executables
if(ENABLE_DOCTESTS)
include(Doctest)
add_definitions(-DENABLE_DOCTEST_IN_LIBRARY)
endif()
include(ProcessorCount)
processorcount(N)
if(NOT N EQUAL 0)
set(CTEST_BUILD_FLAGS -j${N})
endif()
include(Architectures)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
#include(PositionIndependentExecutable)
# Optional IPO. Do not use IPO if it's not supported by compiler.
#include(CheckIPOSupported)
#check_ipo_supported(RESULT aResult OUTPUT aOutput)
#if(aResult)
# set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
#else()
# message(WARNING "IPO is not supported:# ${aOutput}")
#endif()
include(Sanitizers)
#include(DependencyGraph)
#gen_dep_graph(OUTPUT_DIR ${CMAKE_INSTALL_PREFIX} TARGET_NAME dependency-graph OUTPUT_TYPE pdf)
#include(Tools)
#clang_tidy(-format-style=file -checks=* -header-filter='${CMAKE_SOURCE_DIR}/*')
#cppcheck(--enable=warning,performance,portability,missingInclude --template="[{severity}][{id}] {message} {callstack} \(On {file}:{line}\)" --suppress=missingIncludeSystem --quiet --verbose --force)
#include_what_you_use(-Xiwyu)
if(BUILD_DOCS OR BUILD_ONLY_DOCS)
add_subdirectory(docs)
if(BUILD_ONLY_DOCS)
return()
endif()
endif()
if(BUILD_TESTS)
include(Doctest)
add_subdirectory(tests)
endif()
add_subdirectory(src)
if(BUILD_EXTRAS)
add_subdirectory(extras)
endif()
add_subdirectory(apps)