Skip to content

Commit

Permalink
alibuild compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Barthelemy committed Aug 24, 2017
1 parent 367cc19 commit c28485c
Show file tree
Hide file tree
Showing 22 changed files with 2,229 additions and 438 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.2 FATAL_ERROR)

### CMP0025 Compiler id for Apple Clang is now AppleClang.
### CMP0042 MACOSX_RPATH is enabled by default.

FOREACH (p
CMP0025 # CMake 3.0
CMP0042 # CMake 3.0
)
IF (POLICY ${p})
cmake_policy(SET ${p} NEW)
ENDIF ()
endforeach ()


add_subdirectory(Framework)
add_subdirectory(Modules)
add_subdirectory(doc)
15 changes: 0 additions & 15 deletions Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
# General project definition
####################################

CMAKE_MINIMUM_REQUIRED(VERSION 3.5.2 FATAL_ERROR)

### CMP0025 Compiler id for Apple Clang is now AppleClang.
### CMP0042 MACOSX_RPATH is enabled by default.

FOREACH (p
CMP0025 # CMake 3.0
CMP0042 # CMake 3.0
)
IF (POLICY ${p})
cmake_policy(SET ${p} NEW)
ENDIF ()
endforeach ()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)

Expand All @@ -24,7 +10,6 @@ project(QualityControl)
# Load some basic macros which are needed later on
include(O2Utils)
include(QualityControlDependencies)
include(O2) # to be removed

# TODO make it required, once in its own repo
if(ROOT_FOUND)
Expand Down
3 changes: 0 additions & 3 deletions Modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
project(QualityControlModules)

# Load some basic macros which are needed later on
include(O2)
include(O2Utils)
include(QualityControlDependencies)

Expand Down Expand Up @@ -64,8 +63,6 @@ ENDIF ()
# Add compiler flags for warnings and (more importantly) fPIC and debug symbols
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -fPIC")

link_o2_subproject(QualityControl)

add_subdirectory(Common)
add_subdirectory(Example)
add_subdirectory(Skeleton)
Expand Down
89 changes: 0 additions & 89 deletions cmake/CPackConfig.cmake

This file was deleted.

36 changes: 36 additions & 0 deletions cmake/FindCommon.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# - Try to find the O2 Common package include dirs and libraries
# Author: Barthelemy von Haller
#
# This script will set the following variables:
# Common_FOUND - System has Common
# Common_INCLUDE_DIRS - The Common include directories
# Common_LIBRARIES - The libraries needed to use Common
# Common_DEFINITIONS - Compiler switches required for using Common
#
# This script can use the following variables:
# Common_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)

# Init
include(FindPackageHandleStandardArgs)

# find includes
find_path(COMMON_INCLUDE_DIR Timer.h
HINTS ${Common_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Common" "../../include/Common" )
# Remove the final "Common"
get_filename_component(COMMON_INCLUDE_DIR ${COMMON_INCLUDE_DIR} DIRECTORY)
set(Common_INCLUDE_DIRS ${COMMON_INCLUDE_DIR})

# find library
find_library(COMMON_LIBRARY NAMES Common HINTS ${Common_ROOT}/lib ENV LD_LIBRARY_PATH)
set(Common_LIBRARIES ${COMMON_LIBRARY})

# handle the QUIETLY and REQUIRED arguments and set COMMON_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Common "Common could not be found. Install package Common or set Common_ROOT to its root installation directory."
COMMON_LIBRARY COMMON_INCLUDE_DIR)

if(${COMMON_FOUND})
message(STATUS "Common found : ${Common_LIBRARIES}")
endif()

mark_as_advanced(COMMON_INCLUDE_DIR COMMON_LIBRARY)
36 changes: 36 additions & 0 deletions cmake/FindConfiguration.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# - Try to find the O2 Configuration package include dirs and libraries
# Author: Barthelemy von Haller
#
# This script will set the following variables:
# Configuration_FOUND - System has Configuration
# Configuration_INCLUDE_DIRS - The Configuration include directories
# Configuration_LIBRARIES - The libraries needed to use Configuration
# Configuration_DEFINITIONS - Compiler switches required for using Configuration
#
# This script can use the following variables:
# Configuration_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)

# Init
include(FindPackageHandleStandardArgs)

# find includes
find_path(CONFIGURATION_INCLUDE_DIR Configuration.h
HINTS ${Configuration_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/Configuration" "../../include/Configuration" )
# Remove the final "Configuration"
get_filename_component(CONFIGURATION_INCLUDE_DIR ${CONFIGURATION_INCLUDE_DIR} DIRECTORY)
set(Configuration_INCLUDE_DIRS ${CONFIGURATION_INCLUDE_DIR})

# find library
find_library(CONFIGURATION_LIBRARY NAMES Configuration HINTS ${Configuration_ROOT}/lib ENV LD_LIBRARY_PATH)
set(Configuration_LIBRARIES ${CONFIGURATION_LIBRARY})

# handle the QUIETLY and REQUIRED arguments and set CONFIGURATION_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Configuration "Configuration could not be found. Install package Configuration or set Configuration_ROOT to its root installation directory."
CONFIGURATION_LIBRARY CONFIGURATION_INCLUDE_DIR)

if(${CONFIGURATION_FOUND})
message(STATUS "Configuration found : ${Configuration_LIBRARIES}")
endif()

mark_as_advanced(CONFIGURATION_INCLUDE_DIR CONFIGURATION_LIBRARY)
36 changes: 36 additions & 0 deletions cmake/FindDataSampling.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# - Try to find the O2 DataSampling package include dirs and libraries
# Author: Barthelemy von Haller
#
# This script will set the following variables:
# DataSampling_FOUND - System has DataSampling
# DataSampling_INCLUDE_DIRS - The DataSampling include directories
# DataSampling_LIBRARIES - The libraries needed to use DataSampling
# DataSampling_DEFINITIONS - Compiler switches required for using DataSampling
#
# This script can use the following variables:
# DataSampling_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)

# Init
include(FindPackageHandleStandardArgs)

# find includes
find_path(DATASAMPLING_INCLUDE_DIR SamplerInterface.h
HINTS ${DataSampling_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/DataSampling" "../../include/DataSampling" )
# Remove the final "DataSampling"
get_filename_component(DATASAMPLING_INCLUDE_DIR ${DATASAMPLING_INCLUDE_DIR} DIRECTORY)
set(DataSampling_INCLUDE_DIRS ${DATASAMPLING_INCLUDE_DIR})

# find library
find_library(DATASAMPLING_LIBRARY NAMES DataSampling HINTS ${DataSampling_ROOT}/lib ENV LD_LIBRARY_PATH)
set(DataSampling_LIBRARIES ${DATASAMPLING_LIBRARY})

# handle the QUIETLY and REQUIRED arguments and set DATASAMPLING_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(DataSampling "DataSampling could not be found. Install package DataSampling or set DataSampling_ROOT to its root installation directory."
DATASAMPLING_LIBRARY DATASAMPLING_INCLUDE_DIR)

if(${DataSampling_FOUND})
message(STATUS "DataSampling found : ${DataSampling_LIBRARIES}")
endif()

mark_as_advanced(DATASAMPLING_INCLUDE_DIR DATASAMPLING_LIBRARY)
58 changes: 58 additions & 0 deletions cmake/FindFairRoot.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
################################################################################
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence version 3 (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
# Find FairRoot installation
# Check the environment variable "FAIRROOTPATH" or "FAIRROOT_ROOT"

if(FairRoot_DIR)
SET(FAIRROOTPATH ${FairRoot_DIR})
elseif(DEFINED ENV{FAIRROOT_ROOT})
SET(FAIRROOTPATH $ENV{FAIRROOT_ROOT})
else()
if(NOT DEFINED ENV{FAIRROOTPATH})
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." )
if(FairRoot_FIND_REQUIRED)
MESSAGE(FATAL_ERROR ${user_message})
else(FairRoot_FIND_REQUIRED)
MESSAGE(WARNING ${user_message})
return()
endif(FairRoot_FIND_REQUIRED)
endif(NOT DEFINED ENV{FAIRROOTPATH})

SET(FAIRROOTPATH $ENV{FAIRROOTPATH})
endif()

MESSAGE(STATUS "Setting FairRoot environment…")

FIND_PATH(FAIRROOT_INCLUDE_DIR NAMES FairRun.h PATHS
${FAIRROOTPATH}/include
NO_DEFAULT_PATH
)

FIND_PATH(FAIRROOT_LIBRARY_DIR NAMES libBase.so libBase.dylib PATHS
${FAIRROOTPATH}/lib
NO_DEFAULT_PATH
)

FIND_PATH(FAIRROOT_CMAKEMOD_DIR NAMES CMakeLists.txt PATHS
${FAIRROOTPATH}/share/fairbase/cmake
NO_DEFAULT_PATH
)


if(FAIRROOT_INCLUDE_DIR AND FAIRROOT_LIBRARY_DIR)
set(FAIRROOT_FOUND TRUE)
MESSAGE(STATUS "FairRoot ... - found ${FAIRROOTPATH}")
MESSAGE(STATUS "FairRoot Library directory : ${FAIRROOT_LIBRARY_DIR}")
MESSAGE(STATUS "FairRoot Include path… : ${FAIRROOT_INCLUDE_DIR}")
MESSAGE(STATUS "FairRoot Cmake Modules : ${FAIRROOT_CMAKEMOD_DIR}")

else(FAIRROOT_INCLUDE_DIR AND FAIRROOT_LIBRARY_DIR)
set(FAIRROOT_FOUND FALSE)
#MESSAGE(FATAL_ERROR "FairRoot installation not found")
endif (FAIRROOT_INCLUDE_DIR AND FAIRROOT_LIBRARY_DIR)

36 changes: 36 additions & 0 deletions cmake/FindInfoLogger.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# - Try to find the O2 InfoLogger package include dirs and libraries
# Author: Barthelemy von Haller
#
# This script will set the following variables:
# InfoLogger_FOUND - System has InfoLogger
# InfoLogger_INCLUDE_DIRS - The InfoLogger include directories
# InfoLogger_LIBRARIES - The libraries needed to use InfoLogger
# InfoLogger_DEFINITIONS - Compiler switches required for using InfoLogger
#
# This script can use the following variables:
# InfoLogger_ROOT - Installation root to tell this module where to look. (it tries LD_LIBRARY_PATH otherwise)

# Init
include(FindPackageHandleStandardArgs)

# find includes
find_path(INFOLOGGER_INCLUDE_DIR InfoLogger.h
HINTS ${InfoLogger_ROOT}/include ENV LD_LIBRARY_PATH PATH_SUFFIXES "../include/InfoLogger" "../../include/InfoLogger" )
# Remove the final "InfoLogger"
get_filename_component(INFOLOGGER_INCLUDE_DIR ${INFOLOGGER_INCLUDE_DIR} DIRECTORY)
set(InfoLogger_INCLUDE_DIRS ${INFOLOGGER_INCLUDE_DIR})

# find library
find_library(INFOLOGGER_LIBRARY NAMES InfoLogger HINTS ${InfoLogger_ROOT}/lib ENV LD_LIBRARY_PATH)
set(InfoLogger_LIBRARIES ${INFOLOGGER_LIBRARY})

# handle the QUIETLY and REQUIRED arguments and set INFOLOGGER_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(InfoLogger "InfoLogger could not be found. Install package InfoLogger or set InfoLogger_ROOT to its root installation directory."
INFOLOGGER_LIBRARY INFOLOGGER_INCLUDE_DIR)

if(${InfoLogger_FOUND})
message(STATUS "InfoLogger found : ${InfoLogger_LIBRARIES}")
endif()

mark_as_advanced(INFOLOGGER_INCLUDE_DIR INFOLOGGER_LIBRARY)
Loading

0 comments on commit c28485c

Please sign in to comment.