Skip to content

Commit 590bb53

Browse files
committed
alibuild compatible
1 parent 7b01299 commit 590bb53

19 files changed

+2457
-2698
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build
22
.idea
33
.project
4-
.cproject
4+
.cproject
5+
cmake-build-*

CMakeLists.txt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44

55
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.2 FATAL_ERROR)
66

7-
find_package(ZeroMQ REQUIRED)
8-
if (NOT ZeroMQ_INCLUDE_DIR)
9-
set(ZeroMQ_INCLUDE_DIR ${ZEROMQ_INCLUDE_DIR})
10-
set(ZeroMQ_LIBRARIES ${ZEROMQ_LIBRARIES})
11-
endif ()
12-
13-
147
### CMP0025 Compiler id for Apple Clang is now AppleClang.
158
### CMP0042 MACOSX_RPATH is enabled by default.
169

@@ -31,7 +24,6 @@ project(Readout)
3124
# Load some basic macros which are needed later on
3225
include(O2Utils)
3326
include(ReadoutDependencies)
34-
include(O2)
3527

3628
# Set the default build type to "RelWithDebInfo"
3729
if (NOT CMAKE_BUILD_TYPE)
@@ -146,15 +138,6 @@ O2_GENERATE_EXECUTABLE(
146138
)
147139

148140

149-
# TODO RECONSIDER THE THINGS BELOW AFTER EXTRACTION TO ITS OWN REPO
150-
# Make sure we tell the topdir CMakeLists that we exist (if build from topdir)
151-
get_directory_property(hasParent PARENT_DIRECTORY)
152-
if (hasParent)
153-
set(PROJECT_${PROJECT_NAME} true PARENT_SCOPE)
154-
endif ()
155-
include(PackageConfigurator)
156-
157-
158141
# Install some extra files
159142
install(
160143
FILES readout.cfg

cmake/FindCommon.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# - Try to find the O2 Common package include dirs and libraries
2+
# Author: Barthelemy von Haller
3+
#
4+
# This script will set the following variables:
5+
# Common_FOUND - System has Common
6+
# Common_INCLUDE_DIRS - The Common include directories
7+
# Common_LIBRARIES - The libraries needed to use Common
8+
# Common_DEFINITIONS - Compiler switches required for using Common
9+
#
10+
# This script can use the following variables:
11+
# Common_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)
12+
13+
# Init
14+
include(FindPackageHandleStandardArgs)
15+
16+
# find includes
17+
find_path(COMMON_INCLUDE_DIR Timer.h
18+
HINTS ${Common_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Common" "../../include/Common" )
19+
# Remove the final "Common"
20+
get_filename_component(COMMON_INCLUDE_DIR ${COMMON_INCLUDE_DIR} DIRECTORY)
21+
set(Common_INCLUDE_DIRS ${COMMON_INCLUDE_DIR})
22+
23+
# find library
24+
find_library(COMMON_LIBRARY NAMES Common HINTS ${Common_ROOT}/lib ENV LD_LIBRARY_PATH)
25+
set(Common_LIBRARIES ${COMMON_LIBRARY})
26+
27+
# handle the QUIETLY and REQUIRED arguments and set COMMON_FOUND to TRUE
28+
# if all listed variables are TRUE
29+
find_package_handle_standard_args(Common "Common could not be found. Install package Common or set Common_ROOT to its root installation directory."
30+
COMMON_LIBRARY COMMON_INCLUDE_DIR)
31+
32+
if(${COMMON_FOUND})
33+
message(STATUS "Common found : ${Common_LIBRARIES}")
34+
endif()
35+
36+
mark_as_advanced(COMMON_INCLUDE_DIR COMMON_LIBRARY)

cmake/FindConfiguration.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# - Try to find the O2 Configuration package include dirs and libraries
2+
# Author: Barthelemy von Haller
3+
#
4+
# This script will set the following variables:
5+
# Configuration_FOUND - System has Configuration
6+
# Configuration_INCLUDE_DIRS - The Configuration include directories
7+
# Configuration_LIBRARIES - The libraries needed to use Configuration
8+
# Configuration_DEFINITIONS - Compiler switches required for using Configuration
9+
#
10+
# This script can use the following variables:
11+
# Configuration_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)
12+
13+
# Init
14+
include(FindPackageHandleStandardArgs)
15+
16+
# find includes
17+
find_path(CONFIGURATION_INCLUDE_DIR Configuration.h
18+
HINTS ${Configuration_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Configuration" "../../include/Configuration" )
19+
# Remove the final "Configuration"
20+
get_filename_component(CONFIGURATION_INCLUDE_DIR ${CONFIGURATION_INCLUDE_DIR} DIRECTORY)
21+
set(Configuration_INCLUDE_DIRS ${CONFIGURATION_INCLUDE_DIR})
22+
23+
# find library
24+
find_library(CONFIGURATION_LIBRARY NAMES Configuration HINTS ${Configuration_ROOT}/lib ENV LD_LIBRARY_PATH)
25+
set(Configuration_LIBRARIES ${CONFIGURATION_LIBRARY})
26+
27+
# handle the QUIETLY and REQUIRED arguments and set CONFIGURATION_FOUND to TRUE
28+
# if all listed variables are TRUE
29+
find_package_handle_standard_args(Configuration "Configuration could not be found. Install package Configuration or set Configuration_ROOT to its root installation directory."
30+
CONFIGURATION_LIBRARY CONFIGURATION_INCLUDE_DIR)
31+
32+
if(${CONFIGURATION_FOUND})
33+
message(STATUS "Configuration found : ${Configuration_LIBRARIES}")
34+
endif()
35+
36+
mark_as_advanced(CONFIGURATION_INCLUDE_DIR CONFIGURATION_LIBRARY)

cmake/FindDataSampling.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# - Try to find the O2 DataSampling package include dirs and libraries
2+
# Author: Barthelemy von Haller
3+
#
4+
# This script will set the following variables:
5+
# DataSampling_FOUND - System has DataSampling
6+
# DataSampling_INCLUDE_DIRS - The DataSampling include directories
7+
# DataSampling_LIBRARIES - The libraries needed to use DataSampling
8+
# DataSampling_DEFINITIONS - Compiler switches required for using DataSampling
9+
#
10+
# This script can use the following variables:
11+
# DataSampling_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)
12+
13+
# Init
14+
include(FindPackageHandleStandardArgs)
15+
16+
# find includes
17+
find_path(DATASAMPLING_INCLUDE_DIR SamplerInterface.h
18+
HINTS ${DataSampling_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/DataSampling" "../../include/DataSampling" )
19+
# Remove the final "DataSampling"
20+
get_filename_component(DATASAMPLING_INCLUDE_DIR ${DATASAMPLING_INCLUDE_DIR} DIRECTORY)
21+
set(DataSampling_INCLUDE_DIRS ${DATASAMPLING_INCLUDE_DIR})
22+
23+
# find library
24+
find_library(DATASAMPLING_LIBRARY NAMES DataSampling HINTS ${DataSampling_ROOT}/lib ENV LD_LIBRARY_PATH)
25+
set(DataSampling_LIBRARIES ${DATASAMPLING_LIBRARY})
26+
27+
# handle the QUIETLY and REQUIRED arguments and set DATASAMPLING_FOUND to TRUE
28+
# if all listed variables are TRUE
29+
find_package_handle_standard_args(DataSampling "DataSampling could not be found. Install package DataSampling or set DataSampling_ROOT to its root installation directory."
30+
DATASAMPLING_LIBRARY DATASAMPLING_INCLUDE_DIR)
31+
32+
if(${DataSampling_FOUND})
33+
message(STATUS "DataSampling found : ${DataSampling_LIBRARIES}")
34+
endif()
35+
36+
mark_as_advanced(DATASAMPLING_INCLUDE_DIR DATASAMPLING_LIBRARY)

cmake/FindFairRoot.cmake

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
################################################################################
2+
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
3+
# #
4+
# This software is distributed under the terms of the #
5+
# GNU Lesser General Public Licence version 3 (LGPL) version 3, #
6+
# copied verbatim in the file "LICENSE" #
7+
################################################################################
8+
# Find FairRoot installation
9+
# Check the environment variable "FAIRROOTPATH" or "FAIRROOT_ROOT"
10+
11+
if(FairRoot_DIR)
12+
SET(FAIRROOTPATH ${FairRoot_DIR})
13+
elseif(DEFINED ENV{FAIRROOT_ROOT})
14+
SET(FAIRROOTPATH $ENV{FAIRROOT_ROOT})
15+
else()
16+
if(NOT DEFINED ENV{FAIRROOTPATH})
17+
set(user_message "You did not define the environment variable FAIRROOTPATH or FAIRROOT_ROOT which are needed to find FairRoot.\nPlease set one of these variables and execute cmake again." )
18+
if(FairRoot_FIND_REQUIRED)
19+
MESSAGE(FATAL_ERROR ${user_message})
20+
else(FairRoot_FIND_REQUIRED)
21+
MESSAGE(WARNING ${user_message})
22+
return()
23+
endif(FairRoot_FIND_REQUIRED)
24+
endif(NOT DEFINED ENV{FAIRROOTPATH})
25+
26+
SET(FAIRROOTPATH $ENV{FAIRROOTPATH})
27+
endif()
28+
29+
MESSAGE(STATUS "Setting FairRoot environment…")
30+
31+
FIND_PATH(FAIRROOT_INCLUDE_DIR NAMES FairRun.h PATHS
32+
${FAIRROOTPATH}/include
33+
NO_DEFAULT_PATH
34+
)
35+
36+
FIND_PATH(FAIRROOT_LIBRARY_DIR NAMES libBase.so libBase.dylib PATHS
37+
${FAIRROOTPATH}/lib
38+
NO_DEFAULT_PATH
39+
)
40+
41+
FIND_PATH(FAIRROOT_CMAKEMOD_DIR NAMES CMakeLists.txt PATHS
42+
${FAIRROOTPATH}/share/fairbase/cmake
43+
NO_DEFAULT_PATH
44+
)
45+
46+
47+
if(FAIRROOT_INCLUDE_DIR AND FAIRROOT_LIBRARY_DIR)
48+
set(FAIRROOT_FOUND TRUE)
49+
MESSAGE(STATUS "FairRoot ... - found ${FAIRROOTPATH}")
50+
MESSAGE(STATUS "FairRoot Library directory : ${FAIRROOT_LIBRARY_DIR}")
51+
MESSAGE(STATUS "FairRoot Include path… : ${FAIRROOT_INCLUDE_DIR}")
52+
MESSAGE(STATUS "FairRoot Cmake Modules : ${FAIRROOT_CMAKEMOD_DIR}")
53+
54+
else(FAIRROOT_INCLUDE_DIR AND FAIRROOT_LIBRARY_DIR)
55+
set(FAIRROOT_FOUND FALSE)
56+
#MESSAGE(FATAL_ERROR "FairRoot installation not found")
57+
endif (FAIRROOT_INCLUDE_DIR AND FAIRROOT_LIBRARY_DIR)
58+

cmake/FindInfoLogger.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# - Try to find the O2 InfoLogger package include dirs and libraries
2+
# Author: Barthelemy von Haller
3+
#
4+
# This script will set the following variables:
5+
# InfoLogger_FOUND - System has InfoLogger
6+
# InfoLogger_INCLUDE_DIRS - The InfoLogger include directories
7+
# InfoLogger_LIBRARIES - The libraries needed to use InfoLogger
8+
# InfoLogger_DEFINITIONS - Compiler switches required for using InfoLogger
9+
#
10+
# This script can use the following variables:
11+
# InfoLogger_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)
12+
13+
# Init
14+
include(FindPackageHandleStandardArgs)
15+
16+
# find includes
17+
find_path(INFOLOGGER_INCLUDE_DIR InfoLogger.h
18+
HINTS ${InfoLogger_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/InfoLogger" "../../include/InfoLogger" )
19+
# Remove the final "InfoLogger"
20+
get_filename_component(INFOLOGGER_INCLUDE_DIR ${INFOLOGGER_INCLUDE_DIR} DIRECTORY)
21+
set(InfoLogger_INCLUDE_DIRS ${INFOLOGGER_INCLUDE_DIR})
22+
23+
# find library
24+
find_library(INFOLOGGER_LIBRARY NAMES InfoLogger HINTS ${InfoLogger_ROOT}/lib ENV LD_LIBRARY_PATH)
25+
set(InfoLogger_LIBRARIES ${INFOLOGGER_LIBRARY})
26+
27+
# handle the QUIETLY and REQUIRED arguments and set INFOLOGGER_FOUND to TRUE
28+
# if all listed variables are TRUE
29+
find_package_handle_standard_args(InfoLogger "InfoLogger could not be found. Install package InfoLogger or set InfoLogger_ROOT to its root installation directory."
30+
INFOLOGGER_LIBRARY INFOLOGGER_INCLUDE_DIR)
31+
32+
if(${InfoLogger_FOUND})
33+
message(STATUS "InfoLogger found : ${InfoLogger_LIBRARIES}")
34+
endif()
35+
36+
mark_as_advanced(INFOLOGGER_INCLUDE_DIR INFOLOGGER_LIBRARY)

cmake/FindMonitoring.cmake

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# - Tries to find the O2 Monitoring package (include dir and library)
2+
# Author: Barthelemy von Haller
3+
# Author: Adam Wegrzynek
4+
#
5+
#
6+
# This module will set the following non-cached variables:
7+
# Monitoring_FOUND - states whether Monitoring package has been found
8+
# Monitoring_INCLUDE_DIRS - Monitoring include directory
9+
# Monitoring_LIBRARIES - Monitoring library filepath
10+
# Monitoring_DEFINITIONS - Compiler definitions when comping code using Monitoring
11+
#
12+
# Also following cached variables, but not for general use, are defined:
13+
# MONITORING_INCLUDE_DIR
14+
# MONITORING_LIBRARY
15+
#
16+
# This module respects following variables:
17+
# Monitoring_ROOT - Installation root directory (otherwise it goes through LD_LIBRARY_PATH and ENV)
18+
19+
# Init
20+
include(FindPackageHandleStandardArgs)
21+
22+
# find includes
23+
find_path(MONITORING_INCLUDE_DIR Collector.h
24+
HINTS ${Monitoring_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Monitoring" "../../include/Monitoring" )
25+
26+
# Remove the final "Monitoring"
27+
get_filename_component(MONITORING_INCLUDE_DIR ${MONITORING_INCLUDE_DIR} DIRECTORY)
28+
set(Monitoring_INCLUDE_DIRS ${MONITORING_INCLUDE_DIR})
29+
30+
# find library
31+
find_library(MONITORING_LIBRARY NAMES Monitoring HINTS ${Monitoring_ROOT}/lib ENV LD_LIBRARY_PATH)
32+
set(Monitoring_LIBRARIES ${MONITORING_LIBRARY})
33+
34+
# handle the QUIETLY and REQUIRED arguments and set Monitoring_FOUND to TRUE
35+
# if all listed variables are TRUE
36+
find_package_handle_standard_args(Monitoring "Monitoring could not be found. Set Monitoring_ROOT as root installation directory."
37+
MONITORING_LIBRARY MONITORING_INCLUDE_DIR)
38+
if(${Monitoring_FOUND})
39+
set(Monitoring_DEFINITIONS "")
40+
message(STATUS "Monitoring found : ${Monitoring_LIBRARIES}")
41+
endif()
42+
43+
mark_as_advanced(MONITORING_INCLUDE_DIR MONITORING_LIBRARY)

cmake/FindReadoutCard.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# - Try to find the O2 ReadoutCard package include dirs and libraries
2+
# Author: Barthelemy von Haller
3+
#
4+
# This script will set the following variables:
5+
# ReadoutCard_FOUND - System has ReadoutCard
6+
# ReadoutCard_INCLUDE_DIRS - The ReadoutCard include directories
7+
# ReadoutCard_LIBRARIES - The libraries needed to use ReadoutCard
8+
# ReadoutCard_DEFINITIONS - Compiler switches required for using ReadoutCard
9+
#
10+
# This script can use the following variables:
11+
# ReadoutCard_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)
12+
13+
# Init
14+
include(FindPackageHandleStandardArgs)
15+
16+
# find includes
17+
find_path(READOUTCARD_INCLUDE_DIR ReadoutCard.h
18+
HINTS ${ReadoutCard_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/ReadoutCard" "../../include/ReadoutCard" )
19+
# Remove the final "ReadoutCard"
20+
get_filename_component(READOUTCARD_INCLUDE_DIR ${READOUTCARD_INCLUDE_DIR} DIRECTORY)
21+
set(ReadoutCard_INCLUDE_DIRS ${READOUTCARD_INCLUDE_DIR})
22+
23+
# find library
24+
find_library(READOUTCARD_LIBRARY NAMES ReadoutCard HINTS ${ReadoutCard_ROOT}/lib ENV LD_LIBRARY_PATH)
25+
set(ReadoutCard_LIBRARIES ${READOUTCARD_LIBRARY})
26+
27+
# handle the QUIETLY and REQUIRED arguments and set READOUTCARD_FOUND to TRUE
28+
# if all listed variables are TRUE
29+
find_package_handle_standard_args(ReadoutCard "ReadoutCard could not be found. Install package ReadoutCard or set ReadoutCard_ROOT to its root installation directory."
30+
READOUTCARD_LIBRARY READOUTCARD_INCLUDE_DIR)
31+
32+
if(${ReadoutCard_ROOT})
33+
message(STATUS "ReadoutCard found : ${ReadoutCard_LIBRARIES}")
34+
endif()
35+
36+
mark_as_advanced(READOUTCARD_INCLUDE_DIR READOUTCARD_LIBRARY)

0 commit comments

Comments
 (0)