-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·127 lines (105 loc) · 4.28 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
127
# ======================================================================
# otsdaq-demo main build file
#
# cd .../path/to/build/directory
# source .../path/to/otsdaq-demo/ups/setup_for_development
# buildtool
# ======================================================================
# use cmake 3.17 or later
cmake_minimum_required (VERSION 3.19 FATAL_ERROR)
find_package(cetmodules 3.16.00 REQUIRED)
project(otsdaq_demo VERSION 2.10.00)
include(CetCMakeEnv)
cet_cmake_env()
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0.0)
# Clang 14 has a bug in which it complains about destructors of template classes
# e.g. ArtdaqInput<T>::~ArtdaqInput(), when it is expecting the destructor name to
# match what is on the left-hand side of the ::. This is a violation, however, of
# the C++20 standard. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1787r6.html
set(DT_FLAG -Wno-dtor-name)
else()
set(DT_FLAG)
endif()
cet_set_compiler_flags(DIAGS VIGILANT
WERROR
NO_UNDEFINED
EXTRA_FLAGS -pedantic -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES=1 ${DT_FLAG}
)
# Debug streamer.
string(TOUPPER ${CMAKE_BUILD_TYPE} BTYPE_UC)
if(BTYPE_UC STREQUAL DEBUG)
add_definitions(-DDEBUGME)
if(DEFINED ENV{USE_ASAN})
if($ENV{USE_ASAN} GREATER 0)
message("!!! Address Sanitizer Activated!!!")
add_compile_options(-fsanitize=address -Wno-unused-command-line-argument)
add_link_options(-lasan)
endif()
endif()
if(DEFINED ENV{USE_TSAN})
if($ENV{USE_TSAN} GREATER 0)
message("!!! Thread Sanitizer Activated!!!")
add_compile_options(-fsanitize=thread -Wno-unused-command-line-argument)
add_link_options(-ltsan)
endif()
endif()
if(DEFINED ENV{USE_UBSAN})
if($ENV{USE_UBSAN} GREATER 0)
message("!!! Undefined Behavior Sanitizer Activated!!!")
add_compile_options(-fsanitize=undefined -Wno-unused-command-line-argument)
add_link_options(-lubsan)
endif()
endif()
if(DEFINED ENV{USE_GCOV})
add_compile_options(-fprofile-arcs -ftest-coverage --coverage)
add_link_options(--coverage)
endif()
endif()
#cet_report_compiler_flags()
find_package(otsdaq 2.06.06 REQUIRED)
find_package(otsdaq_components 2.06.06 REQUIRED)
# XDAQ Extra setup
include_directories($ENV{XDAQ_ROOT}/include/linux $ENV{XDAQ_ROOT}/include)
link_directories($ENV{XDAQ_ROOT}/lib)
link_directories($ENV{ARTDAQ_DATABASE_LIB})
set(XDAQ_BASIC_LIB_LIST
xcept
xoap
xdaq
toolbox
xerces-c
cgicc
)
set(XDAQ_XERCES-C xerces-c)
#string(REGEX MATCHALL "[0-9][0-9]?[0-9]?" ART_VERSION_LIST "$ENV{ART_VERSION}")
#list(GET ART_VERSION_LIST 0 ART_MAJOR_VERSION)
#list(GET ART_VERSION_LIST 1 ART_MINOR_VERSION)
#list(GET ART_VERSION_LIST 2 ART_PATCH_VERSION)
#message("-DART_HEX_VERSION=0x${ART_MAJOR_VERSION}${ART_MINOR_VERSION}${ART_PATCH_VERSION}")
#set(ART_HEX_VERSION 0x${ART_MAJOR_VERSION}${ART_MINOR_VERSION}${ART_PATCH_VERSION})
#add_definitions(-DART_HEX_VERSION=0x${ART_MAJOR_VERSION}${ART_MINOR_VERSION}${ART_PATCH_VERSION})
#string(REGEX MATCHALL "[0-9][0-9]?[0-9]?" MESSAGEFACILITY_VERSION_LIST "$ENV{MESSAGEFACILITY_VERSION}")
#list(GET MESSAGEFACILITY_VERSION_LIST 0 MESSAGEFACILITY_MAJOR_VERSION)
#list(GET MESSAGEFACILITY_VERSION_LIST 1 MESSAGEFACILITY_MINOR_VERSION)
#list(GET MESSAGEFACILITY_VERSION_LIST 2 MESSAGEFACILITY_PATCH_VERSION)
#message("-DMESSAGEFACILITY_HEX_VERSION=0x${MESSAGEFACILITY_MAJOR_VERSION}${MESSAGEFACILITY_MINOR_VERSION}${MESSAGEFACILITY_PATCH_VERSION}")
#add_definitions(-DMESSAGEFACILITY_HEX_VERSION=0x${MESSAGEFACILITY_MAJOR_VERSION}${MESSAGEFACILITY_MINOR_VERSION}${MESSAGEFACILITY_PATCH_VERSION})
#string(REGEX MATCHALL "[0-9][0-9]?[0-9]?" CANVAS_VERSION_LIST "$ENV{CANVAS_VERSION}")
#list(GET CANVAS_VERSION_LIST 0 CANVAS_MAJOR_VERSION)
#list(GET CANVAS_VERSION_LIST 1 CANVAS_MINOR_VERSION)
#list(GET CANVAS_VERSION_LIST 2 CANVAS_PATCH_VERSION)
#message("-DCANVAS_HEX_VERSION=0x${CANVAS_MAJOR_VERSION}${CANVAS_MINOR_VERSION}${CANVAS_PATCH_VERSION}")
#add_definitions(-DCANVAS_HEX_VERSION=0x${CANVAS_MAJOR_VERSION}${CANVAS_MINOR_VERSION}${CANVAS_PATCH_VERSION})
# Code
add_subdirectory(otsdaq-demo)
# Useful scripts
add_subdirectory(tools)
# Test Programs
add_subdirectory(test)
# Documentation directory
if( $ENV{OTS_DOXY} MATCHES "DOIT" )
add_subdirectory(doc)
endif()
cet_cmake_config()