add_subdirectory (STAT)
add_subdirectory (OADB)
add_subdirectory (ANALYSIS)
-#add_subdirectory (RAW)
+add_subdirectory (RAW)
#add_subdirectory (ITS)
#add_subdirectory (TPC)
#add_subdirectory (VZERO)
-# AliRoot Build System CMakeLists for RAW
-#
-# Author: Johny Jose m(johny.jose@cern.ch)
-# Port of previous Makefile build to cmake
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# * *
+# * Author: The ALICE Off-line Project. *
+# * Contributors are mentioned in the code where appropriate. *
+# * *
+# * Permission to use, copy, modify and distribute this software and its *
+# * documentation strictly for non-commercial purposes is hereby granted *
+# * without fee, provided that the above copyright notice appears in all *
+# * copies and that both the copyright notice and this permission notice *
+# * appear in the supporting documentation. The authors make no claims *
+# * about the suitability of this software for any purpose. It is *
+# * provided "as is" without express or implied warranty. *
+# **************************************************************************
-cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
-
-file(GLOB PACKAGES CMake*.pkg)
-
-ALICE_BuildModule()
+# include the libraries
+add_subdirectory (RAWDatabase)
+add_subdirectory (RAWDatarec)
+add_subdirectory (RAWDatasim)
+add_subdirectory (RAWDatarecOnline)
+add_subdirectory (MDC)
+add_subdirectory (alirawdump)
# Additional include folders in alphabetical order except ROOT
include_directories(${ROOT_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/ITS
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatabase
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatarec
${CMAKE_SOURCE_DIR}/STEER/ESD
${CMAKE_SOURCE_DIR}/STEER/STEERBase
${CMAKE_SOURCE_DIR}/TPC
get_directory_property(incdirs INCLUDE_DIRECTORIES)
generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
+# Generate the ROOT map
+# Dependecies
+set(LIBDEPS ITS ESD RAWDataBase RAWDatarec STEERBase TPC)
+generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+
# Add a library to the project using the specified source files
add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
// //
//////////////////////////////////////////////////////////////////////////
+
#ifndef ROOT_TObject
#include <TObject.h>
#endif
#include <TString.h>
#endif
-
// Forward class declarations
-class TH1F;
-
+#ifndef ROOT_TH1F
+#include <TH1F.h>
+#endif
class AliStats : public TObject {
string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
# Extra headers in alphabetical order
-set(HDRS ${HDRS} AliRawEventHeaderVersions.h)
+set(HDRS ${HDRS} AliRawEventHeaderVersions.h AliRawDataHeader.h AliRawDataHeaderV3.h)
# Generate the dictionary
# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
get_directory_property(incdirs INCLUDE_DIRECTORIES)
generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
+# Generate the ROOT map
+# Dependecies
+set(LIBDEPS ESD STEERBase)
+generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+
# Add a library to the project using the specified source files
add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
# Additional include folders in alphabetical order except ROOT
include_directories(${ROOT_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/HLT/rec
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatabase
${CMAKE_SOURCE_DIR}/STEER/ESD
+ ${CMAKE_SOURCE_DIR}/STEER/STEERBase
)
# Sources in alphabetical order
set(SRCS
get_directory_property(incdirs INCLUDE_DIRECTORIES)
generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
+# Generate the ROOT map
+# Dependecies
+set(LIBDEPS ESD HLTrec RAWDatabase STEERBase)
+generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+
# Add a library to the project using the specified source files
add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
# Additional include folders in alphabetical order except ROOT
include_directories(${ROOT_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatabase
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatarec
${CMAKE_SOURCE_DIR}/STEER/ESD
+ ${CMAKE_SOURCE_DIR}/STEER/STEERBase
)
# Sources in alphabetical order
get_directory_property(incdirs INCLUDE_DIRECTORIES)
generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
+# Generate the ROOT map
+# Dependecies
+set(LIBDEPS ESD RAWDatabase RAWDatarec STEERBase)
+generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+
# Add a library to the project using the specified source files
add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
# Additional include folders in alphabetical order except ROOT
include_directories(${ROOT_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatabase
${CMAKE_SOURCE_DIR}/STEER/STEER
+ ${CMAKE_SOURCE_DIR}/STEER/STEERBase
)
# Sources in alphabetical order
get_directory_property(incdirs INCLUDE_DIRECTORIES)
generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
+# Generate the ROOT map
+# Dependecies
+set(LIBDEPS RAWDatabase STEERBase STEER)
+generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+
# Add a library to the project using the specified source files
add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
${CMAKE_SOURCE_DIR}/STEER/STEERBase
)
-set(ROOTEXTRALIBS "-L${ROOTLIBDIR} -lThread -lGeom -lVMC -lMinuit")
+link_directories(${ROOT_LIBDIR})
+
+# Libraries which are not in the default ROOT list (root-config --libs)
+set(ROOTEXTRALIBS Geom VMC Minuit)
# Add an executable to the project using the specified source files
add_executable(${MODULE} alirawdump_main.cxx)
-target_link_libraries(${MODULE} STEERBase RAWDatabase ${ROOTEXTRALIBS} ${ROOTLIBS})
+
+message(STATUS "LIBS = ${ROOT_LIBRARIES}")
+target_link_libraries(${MODULE} STEERBase RAWDatabase ${ROOTEXTRALIBS} ${ROOT_LIBRARIES})
# Installation
install(TARGETS ${MODULE} RUNTIME DESTINATION bin)
\ No newline at end of file
-cmake_minimum_required (VERSION 2.8)
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# * *
+# * Author: The ALICE Off-line Project. *
+# * Contributors are mentioned in the code where appropriate. *
+# * *
+# * Permission to use, copy, modify and distribute this software and its *
+# * documentation strictly for non-commercial purposes is hereby granted *
+# * without fee, provided that the above copyright notice appears in all *
+# * copies and that both the copyright notice and this permission notice *
+# * appear in the supporting documentation. The authors make no claims *
+# * about the suitability of this software for any purpose. It is *
+# * provided "as is" without express or implied warranty. *
+# **************************************************************************
# Module
set (MODULE alimdc)
include_directories(${CMAKE_SOURCE_DIR}/${MODULE})
-include_directories( ${ROOTSYS}/include ${CMAKE_SOURCE_DIR}/STEER/STEERBase ${CMAKE_SOURCE_DIR}/RAW/RAWDatabase ${CMAKE_SOURCE_DIR}/RAW/RAWDatarec)
-# Standard Root libraries
-execute_process(COMMAND root-config --libs OUTPUT_VARIABLE ROOTLIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
+# Aditional include folders in alphabetical order except ROOT
+include_directories(${ROOT_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/STEER/STEERBase
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatabase
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatarec
+ )
-# Additional Root libraries
-execute_process(COMMAND root-config --libdir OUTPUT_VARIABLE ROOTLIBDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
-set(ROOTEXTRALIBS "-L${ROOTLIBDIR} -lThread -lGeom -lVMC -lMinuit")
+link_directories(${ROOT_LIBDIR})
+
+# ROOT libraries that are not in root-config --libs
+set(ROOTEXTRALIBS Geom VMC Minuit)
# Add an executable to the project using the specified source files
add_executable(${MODULE} alimdc_main.cxx)
-target_link_libraries(${MODULE} STEERBase RAWDatabase ${ROOTEXTRALIBS} ${ROOTLIBS})
+target_link_libraries(${MODULE} STEERBase RAWDatabase ${ROOTEXTRALIBS} ${ROOT_LIBRARIES})
# Installation
install(TARGETS ${MODULE} RUNTIME DESTINATION bin)
-cmake_minimum_required (VERSION 2.8)
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# * *
+# * Author: The ALICE Off-line Project. *
+# * Contributors are mentioned in the code where appropriate. *
+# * *
+# * Permission to use, copy, modify and distribute this software and its *
+# * documentation strictly for non-commercial purposes is hereby granted *
+# * without fee, provided that the above copyright notice appears in all *
+# * copies and that both the copyright notice and this permission notice *
+# * appear in the supporting documentation. The authors make no claims *
+# * about the suitability of this software for any purpose. It is *
+# * provided "as is" without express or implied warranty. *
+# **************************************************************************
# Module
-set (MODULE dateStream)
+set(MODULE dateStream)
+
include_directories(${CMAKE_SOURCE_DIR}/${MODULE})
-include_directories( ${ROOTSYS}/include ${CMAKE_SOURCE_DIR}/STEER/STEERBase ${CMAKE_SOURCE_DIR}/RAW/RAWDatabase ${CMAKE_SOURCE_DIR}/RAW/RAWDatarec)
-# Standard Root libraries
-execute_process(COMMAND root-config --libs OUTPUT_VARIABLE ROOTLIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
+# Aditional include folders in alphabetical order except ROOT
+include_directories(${ROOT_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatabase
+ ${CMAKE_SOURCE_DIR}/RAW/RAWDatarec
+ ${CMAKE_SOURCE_DIR}/STEER/STEERBase
+ )
+
+
+link_directories(${ROOT_LIBDIR})
-# Additional Root libraries
-execute_process(COMMAND root-config --libdir OUTPUT_VARIABLE ROOTLIBDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
-set(ROOTEXTRALIBS "-L${ROOTLIBDIR} -lThread -lGeom -lVMC -lMinuit")
+# Aditional ROOT libraries that are not shoed by root-config --libs
+set(ROOTEXTRALIBS Geom VMC Minuit)
# Add an executable to the project using the specified source files
add_executable(${MODULE} alimdc_main.cxx)
-target_link_libraries(${MODULE} STEERBase RAWDatabase ${ROOTEXTRALIBS} ${ROOTLIBS})
+target_link_libraries(${MODULE} STEERBase RAWDatabase ${ROOTEXTRALIBS} ${ROOT_LIBRARIES})
# Installation
install(TARGETS ${MODULE} RUNTIME DESTINATION bin)
# @LIBDEPS - library dependencies
# @LINKDEF - LinkDef header
macro(generate_rootmap LIBNAME LIBDEPS LINKDEF)
- message(STATUS "LIBNAME = ${LIBNAME}")
- message(STATUS "LIBDEPS = ${LIBDEPS}")
- message(STATUS "LINKDEF = ${LINKDEF}")
+# message(STATUS "LIBNAME = ${LIBNAME}")
+# message(STATUS "LIBDEPS = ${LIBDEPS}")
+# message(STATUS "LINKDEF = ${LINKDEF}")
- message(STATUS "ROOT_LIBMAP=${ROOT_LIBMAP}")
+# message(STATUS "ROOT_LIBMAP=${ROOT_LIBMAP}")
- foreach(d ${LIBDEPS})
- get_filename_component(_ext ${d} EXT)
- if(_ext)
- set(Int_DEPENDENCIES ${Int_DEPENDENCIES} ${d})
+ foreach(file ${LIBDEPS})
+ get_filename_component(ext ${file} EXT)
+ if(ext)
+ set(LOCAL_DEPS ${DEPENDENCIES} ${file})
else()
- set(Int_DEPENDENCIES ${Int_DEPENDENCIES} lib${d}.so)
+ set(LOCAL_DEPS ${DEPENDENCIES} lib${file}.so)
endif()
endforeach()
message(STATUS "Generating ROOT map for ${LIBNAME}")
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap
COMMAND LD_LIBRARY_PATH=${ROOT_LIBDIR}:$ENV{LD_LIBRARY_PATH} ${ROOT_LIBMAP}
- ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap -l lib${LIBNAME}.so -d ${Int_DEPENDENCIES} -c ${LINKDEF}
+ ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap -l lib${LIBNAME}.so -d ${LOCAL_DEPS} -c ${LINKDEF}
DEPENDS ${LIBNAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} VERBATIM
)
# - ROOT_FEATURES - list of build features for ROOT
# - ROOT_LIBDIR - full path to ROOT library folder
# - ROOT_LIBRARIES - libraries needed for the package to be used
+# - ROOT_GLIBRARIES - regular + GUI ROOT libraries + path to be used during linking
# - ROOT_INCLUDE_DIRS - full path to ROOT include folder
-# - ROOT_GLIBS - regular + GUI ROOT libraries + path to be used during linking
# - ROOT_HASALIEN - ROOT was built with AliEn support
# - ROOT_HASXML - ROOT was built with XML support
if(error)
message(FATAL_ERROR "Error retrieving ROOT version : ${error}")
endif(error)
-
+ string(STRIP ${ROOT_VERSION} ROOT_VERSION)
+
# Extract major, minor, and patch versions from
string(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" ROOT_VERSION_MAJOR "${ROOT_VERSION}")
string(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" ROOT_VERSION_MINOR "${ROOT_VERSION}")
else()
message(STATUS "ROOT was build with the following features: ${ROOT_FEATURES}")
endif(error)
-
+ string(STRIP ${ROOT_FEATURES} ROOT_FEATURES)
+
# Checking for ROOT libdir
execute_process(COMMAND ${ROOT_CONFIG} --libdir OUTPUT_VARIABLE ROOT_LIBDIR ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error retrieving ROOT libdir: ${error}")
endif(error)
+ string(STRIP ${ROOT_LIBDIR} ROOT_LIBDIR)
# Checking for ROOT libs
- execute_process(COMMAND ${ROOT_CONFIG} --libs OUTPUT_VARIABLE ROOT_LIBRARIES ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+ execute_process(COMMAND ${ROOT_CONFIG} --noldflags --libs OUTPUT_VARIABLE ROOT_LIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error retrieving ROOT libdir: ${error}")
endif(error)
-
+ string(STRIP ${ROOT_LIBS} ROOT_LIBS)
+
+ foreach(lib ${ROOT_LIBS})
+ string(REPLACE "-rdynamic" "" new_lib ${lib})
+ string(REPLACE "-l" "" lib ${new_lib})
+ set(ROOT_LIBRARIES ${ROOT_LIBRARIES} ${lib})
+ endforeach()
+ string(STRIP ${ROOT_LIBRARIES} ROOT_LIBRARIES)
+ separate_arguments(ROOT_LIBRARIES)
+
# Checking for ROOT incdir
execute_process(COMMAND ${ROOT_CONFIG} --incdir OUTPUT_VARIABLE ROOT_INCDIR ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error retrieving ROOT incdir: ${error}")
endif(error)
-
+ string(STRIP ${ROOT_INCDIR} ROOT_INCDIR)
+
# Checking for glibs
- execute_process(COMMAND ${ROOT_CONFIG} --glibs OUTPUT_VARIABLE ROOT_GLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+ execute_process(COMMAND ${ROOT_CONFIG} --noldflags --glibs OUTPUT_VARIABLE ROOT_GLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error retrieving ROOT glibs: ${error}")
endif(error)
# Checking for glibs
+ string(STRIP ${ROOT_GLIBS} ROOT_GLIBS)
+
+ foreach(lib ${ROOT_GLIBS})
+ string(REPLACE "-rdynamic" "" new_lib "${lib}")
+ string(REPLACE "-l" "" lib "${new_lib}")
+ set(ROOT_GLIBRARIES ${ROOT_GLIBRARIES} ${lib})
+ endforeach()
+ string(STRIP ${ROOT_GLIBRARIES} ROOT_GLIBRARIES)
+ separate_arguments(ROOT_GLIBRARIES)
+
+ # Checking for AliEn support
execute_process(COMMAND ${ROOT_CONFIG} --has-alien OUTPUT_VARIABLE ROOT_HASALIEN ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error checking if ROOT was build with AliEn support: ${error}")
endif(error)
-
+ string(STRIP ${ROOT_HASALIEN} ROOT_HASALIEN)
+
+ # Checking for xml support
execute_process(COMMAND ${ROOT_CONFIG} --has-xml OUTPUT_VARIABLE ROOT_HASXML ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error checking if ROOT was build with xml support: ${error}")
endif(error)
-
+ string(STRIP ${ROOT_HASXML} ROOT_HASXML)
+
set(ROOT_FOUND TRUE)
else()
message(FATAL_ERROR "ROOT installation not found! Please point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR.")