Skip to content

Commit 367cc19

Browse files
committed
QualityControl and QualityControlModules merged in view of extraction
1 parent 6200408 commit 367cc19

92 files changed

Lines changed: 2123 additions & 204 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 2 additions & 201 deletions
Original file line numberDiff line numberDiff line change
@@ -1,202 +1,3 @@
1-
####################################
2-
# General project definition
3-
####################################
4-
5-
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.2 FATAL_ERROR)
6-
7-
### CMP0025 Compiler id for Apple Clang is now AppleClang.
8-
### CMP0042 MACOSX_RPATH is enabled by default.
9-
10-
FOREACH (p
11-
CMP0025 # CMake 3.0
12-
CMP0042 # CMake 3.0
13-
)
14-
IF (POLICY ${p})
15-
cmake_policy(SET ${p} NEW)
16-
ENDIF ()
17-
endforeach ()
18-
19-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
20-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
21-
22-
project(QualityControl)
23-
24-
# Load some basic macros which are needed later on
25-
include(O2Utils)
26-
include(QualityControlDependencies)
27-
include(O2) # to be removed
28-
1+
add_subdirectory(Framework)
2+
add_subdirectory(Modules)
293
add_subdirectory(doc)
30-
31-
# TODO make it required, once in its own repo
32-
if(ROOT_FOUND)
33-
message(STATUS "ROOT ${ROOT_VERSION} found in '${ROOTSYS}'")
34-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ROOTSYS}/share/root/cmake/modules)
35-
include(RootNewMacros)
36-
else()
37-
message(WARNING "ROOT not found, we won't compile the QC (skip, no error)")
38-
return()
39-
endif()
40-
41-
# Set the default build type to "RelWithDebInfo"
42-
if(NOT CMAKE_BUILD_TYPE)
43-
set(CMAKE_BUILD_TYPE "RelWithDebInfo"
44-
CACHE
45-
STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Coverage."
46-
FORCE)
47-
endif(NOT CMAKE_BUILD_TYPE)
48-
49-
# Set the version number of your project here (format is MAJOR.MINOR.PATCHLEVEL - e.g. 1.0.0)
50-
set(VERSION_MAJOR "0")
51-
set(VERSION_MINOR "0")
52-
set(VERSION_PATCH "0")
53-
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
54-
55-
# C++14
56-
IF (CMAKE_VERSION VERSION_LESS 3.1)
57-
include(CheckCXXCompilerFlag)
58-
CHECK_CXX_COMPILER_FLAG(-std=c++14 COMPILER_SUPPORTS_CXX14)
59-
if (COMPILER_SUPPORTS_CXX14)
60-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
61-
else ()
62-
message(ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
63-
endif ()
64-
ELSE ()
65-
set(CMAKE_CXX_STANDARD 14) # proper way in CMake >= 3.1
66-
ENDIF ()
67-
68-
# Add compiler flags for warnings and (more importantly) fPIC and debug symbols
69-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -fPIC")
70-
71-
72-
# TODO RECONSIDER THE THINGS BELOW AFTER EXTRACTION TO ITS OWN REPO
73-
# Make sure we tell the topdir CMakeLists that we exist (if build from topdir)
74-
get_directory_property(hasParent PARENT_DIRECTORY)
75-
if(hasParent)
76-
set(PROJECT_${PROJECT_NAME} true PARENT_SCOPE)
77-
endif()
78-
include(PackageConfigurator)
79-
80-
81-
####################################
82-
# Module, library and executable definition
83-
####################################
84-
85-
set(MODULE_NAME "QualityControl")
86-
87-
O2_SETUP(NAME ${MODULE_NAME})
88-
89-
set(SRCS
90-
src/TaskInterface.cxx
91-
src/MonitorObject.cxx
92-
src/Quality.cxx
93-
src/ObjectsManager.cxx
94-
src/TaskFactory.cxx
95-
src/Checker.cxx
96-
src/CheckInterface.cxx
97-
src/DatabaseFactory.cxx
98-
src/ClientDataProvider.cxx
99-
)
100-
101-
set(HEADERS # needed for the dictionary generation
102-
include/QualityControl/MonitorObject.h
103-
include/QualityControl/Quality.h
104-
include/QualityControl/CheckInterface.h
105-
include/QualityControl/SpyMainFrame.h
106-
)
107-
108-
if (FAIRROOT_FOUND)
109-
list(APPEND SRCS
110-
src/AlfaReceiverForTests.cxx
111-
src/TaskDevice.cxx
112-
src/SpyDevice.cxx
113-
src/SpyMainFrame.cxx
114-
)
115-
endif (FAIRROOT_FOUND)
116-
117-
if(MYSQL_FOUND)
118-
list(APPEND SRCS src/MySqlDatabase.cxx)
119-
endif()
120-
121-
# Produce the final Version.h using template Version.h.in and substituting variables.
122-
# We don't want to polute our source tree with it, thus putting it in binary tree.
123-
configure_file("include/${MODULE_NAME}/Version.h.in"
124-
"${CMAKE_CURRENT_BINARY_DIR}/include/${MODULE_NAME}/Version.h"
125-
@ONLY
126-
)
127-
128-
include_directories(
129-
${CMAKE_CURRENT_BINARY_DIR}/include
130-
)
131-
132-
set(LIBRARY_NAME QualityControl)
133-
134-
if(FAIRROOT_FOUND)
135-
set(BUCKET_NAME o2_qualitycontrol_with_fairroot_bucket)
136-
else()
137-
set(BUCKET_NAME o2_qualitycontrol_bucket)
138-
endif()
139-
140-
set(LINKDEF include/QualityControl/LinkDef.h)
141-
142-
O2_GENERATE_LIBRARY()
143-
144-
# Task Launcher
145-
O2_GENERATE_EXECUTABLE(
146-
EXE_NAME qcTaskLauncher
147-
SOURCES src/TaskDevice.cxx
148-
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
149-
BUCKET_NAME ${BUCKET_NAME}
150-
)
151-
152-
O2_GENERATE_EXECUTABLE(
153-
EXE_NAME qcCheckerLauncher
154-
SOURCES src/qcCheckerLauncher.cxx
155-
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
156-
BUCKET_NAME ${BUCKET_NAME}
157-
)
158-
159-
O2_GENERATE_EXECUTABLE(
160-
EXE_NAME qcSpy
161-
SOURCES src/qcSpy.cxx
162-
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
163-
BUCKET_NAME ${BUCKET_NAME}
164-
)
165-
166-
if (FAIRROOT_FOUND)
167-
O2_GENERATE_EXECUTABLE(
168-
EXE_NAME alfaTestReceiver
169-
SOURCES src/alfaTestReceiver.cxx
170-
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
171-
BUCKET_NAME ${BUCKET_NAME}
172-
)
173-
174-
O2_GENERATE_EXECUTABLE(
175-
EXE_NAME qcConsumer
176-
SOURCES src/Consumer.cxx
177-
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
178-
BUCKET_NAME ${BUCKET_NAME}
179-
)
180-
endif()
181-
182-
if(ROOT_FOUND) # TODO remove this once we have our own repo
183-
set(TEST_SRCS
184-
test/testDbFactory.cxx
185-
test/testMonitorObject.cxx
186-
test/testPublisher.cxx
187-
test/testQcInfoLogger.cxx
188-
test/testQCTask.cxx
189-
test/testQuality.cxx
190-
)
191-
192-
O2_GENERATE_TESTS(
193-
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
194-
BUCKET_NAME ${BUCKET_NAME}
195-
TEST_SRCS ${TEST_SRCS}
196-
)
197-
198-
endif()
199-
200-
# Install extra scripts
201-
install(PROGRAMS script/qcDatabaseSetup.sh DESTINATION bin)
202-
install(FILES example-default.ini alfa.json DESTINATION etc)

Framework/CMakeLists.txt

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
####################################
2+
# General project definition
3+
####################################
4+
5+
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.2 FATAL_ERROR)
6+
7+
### CMP0025 Compiler id for Apple Clang is now AppleClang.
8+
### CMP0042 MACOSX_RPATH is enabled by default.
9+
10+
FOREACH (p
11+
CMP0025 # CMake 3.0
12+
CMP0042 # CMake 3.0
13+
)
14+
IF (POLICY ${p})
15+
cmake_policy(SET ${p} NEW)
16+
ENDIF ()
17+
endforeach ()
18+
19+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
20+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
21+
22+
project(QualityControl)
23+
24+
# Load some basic macros which are needed later on
25+
include(O2Utils)
26+
include(QualityControlDependencies)
27+
include(O2) # to be removed
28+
29+
# TODO make it required, once in its own repo
30+
if(ROOT_FOUND)
31+
message(STATUS "ROOT ${ROOT_VERSION} found in '${ROOTSYS}'")
32+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ROOTSYS}/share/root/cmake/modules)
33+
include(RootNewMacros)
34+
else()
35+
message(WARNING "ROOT not found, we won't compile the QC (skip, no error)")
36+
return()
37+
endif()
38+
39+
# Set the default build type to "RelWithDebInfo"
40+
if(NOT CMAKE_BUILD_TYPE)
41+
set(CMAKE_BUILD_TYPE "RelWithDebInfo"
42+
CACHE
43+
STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Coverage."
44+
FORCE)
45+
endif(NOT CMAKE_BUILD_TYPE)
46+
47+
# Set the version number of your project here (format is MAJOR.MINOR.PATCHLEVEL - e.g. 1.0.0)
48+
set(VERSION_MAJOR "0")
49+
set(VERSION_MINOR "0")
50+
set(VERSION_PATCH "0")
51+
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
52+
53+
# C++14
54+
IF (CMAKE_VERSION VERSION_LESS 3.1)
55+
include(CheckCXXCompilerFlag)
56+
CHECK_CXX_COMPILER_FLAG(-std=c++14 COMPILER_SUPPORTS_CXX14)
57+
if (COMPILER_SUPPORTS_CXX14)
58+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
59+
else ()
60+
message(ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
61+
endif ()
62+
ELSE ()
63+
set(CMAKE_CXX_STANDARD 14) # proper way in CMake >= 3.1
64+
ENDIF ()
65+
66+
# Add compiler flags for warnings and (more importantly) fPIC and debug symbols
67+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -fPIC")
68+
69+
####################################
70+
# Module, library and executable definition
71+
####################################
72+
73+
set(MODULE_NAME "QualityControl")
74+
75+
O2_SETUP(NAME ${MODULE_NAME})
76+
77+
set(SRCS
78+
src/TaskInterface.cxx
79+
src/MonitorObject.cxx
80+
src/Quality.cxx
81+
src/ObjectsManager.cxx
82+
src/TaskFactory.cxx
83+
src/Checker.cxx
84+
src/CheckInterface.cxx
85+
src/DatabaseFactory.cxx
86+
src/ClientDataProvider.cxx
87+
)
88+
89+
set(HEADERS # needed for the dictionary generation
90+
include/QualityControl/MonitorObject.h
91+
include/QualityControl/Quality.h
92+
include/QualityControl/CheckInterface.h
93+
include/QualityControl/SpyMainFrame.h
94+
)
95+
96+
if (FAIRROOT_FOUND)
97+
list(APPEND SRCS
98+
src/AlfaReceiverForTests.cxx
99+
src/TaskDevice.cxx
100+
src/SpyDevice.cxx
101+
src/SpyMainFrame.cxx
102+
)
103+
endif (FAIRROOT_FOUND)
104+
105+
if(MYSQL_FOUND)
106+
list(APPEND SRCS src/MySqlDatabase.cxx)
107+
endif()
108+
109+
# Produce the final Version.h using template Version.h.in and substituting variables.
110+
# We don't want to polute our source tree with it, thus putting it in binary tree.
111+
configure_file("include/${MODULE_NAME}/Version.h.in"
112+
"${CMAKE_CURRENT_BINARY_DIR}/include/${MODULE_NAME}/Version.h"
113+
@ONLY
114+
)
115+
116+
include_directories(
117+
${CMAKE_CURRENT_BINARY_DIR}/include
118+
)
119+
120+
set(LIBRARY_NAME QualityControl)
121+
122+
if(FAIRROOT_FOUND)
123+
set(BUCKET_NAME o2_qualitycontrol_with_fairroot_bucket)
124+
else()
125+
set(BUCKET_NAME o2_qualitycontrol_bucket)
126+
endif()
127+
128+
set(LINKDEF include/QualityControl/LinkDef.h)
129+
130+
O2_GENERATE_LIBRARY()
131+
132+
# Task Launcher
133+
O2_GENERATE_EXECUTABLE(
134+
EXE_NAME qcTaskLauncher
135+
SOURCES src/TaskDevice.cxx
136+
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
137+
BUCKET_NAME ${BUCKET_NAME}
138+
)
139+
140+
O2_GENERATE_EXECUTABLE(
141+
EXE_NAME qcCheckerLauncher
142+
SOURCES src/qcCheckerLauncher.cxx
143+
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
144+
BUCKET_NAME ${BUCKET_NAME}
145+
)
146+
147+
O2_GENERATE_EXECUTABLE(
148+
EXE_NAME qcSpy
149+
SOURCES src/qcSpy.cxx
150+
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
151+
BUCKET_NAME ${BUCKET_NAME}
152+
)
153+
154+
if (FAIRROOT_FOUND)
155+
O2_GENERATE_EXECUTABLE(
156+
EXE_NAME alfaTestReceiver
157+
SOURCES src/alfaTestReceiver.cxx
158+
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
159+
BUCKET_NAME ${BUCKET_NAME}
160+
)
161+
162+
O2_GENERATE_EXECUTABLE(
163+
EXE_NAME qcConsumer
164+
SOURCES src/Consumer.cxx
165+
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
166+
BUCKET_NAME ${BUCKET_NAME}
167+
)
168+
endif()
169+
170+
if(ROOT_FOUND) # TODO remove this once we have our own repo
171+
set(TEST_SRCS
172+
test/testDbFactory.cxx
173+
test/testMonitorObject.cxx
174+
test/testPublisher.cxx
175+
test/testQcInfoLogger.cxx
176+
test/testQCTask.cxx
177+
test/testQuality.cxx
178+
)
179+
180+
O2_GENERATE_TESTS(
181+
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
182+
BUCKET_NAME ${BUCKET_NAME}
183+
TEST_SRCS ${TEST_SRCS}
184+
)
185+
186+
endif()
187+
188+
# Install extra scripts
189+
install(PROGRAMS script/qcDatabaseSetup.sh DESTINATION bin)
190+
install(FILES example-default.ini alfa.json DESTINATION etc)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)