set(LIBDEPS STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim)
generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(ACORDEbase-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(ACORDEbase SHARED $<TARGET_OBJECTS:ACORDEbase-object>)
+target_link_libraries(ACORDEbase STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim)
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
-
-# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+# Additional compilation flags for the object
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-fPIC -O -g")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:ACORDEbase-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static STEERBase-static STEER-static ESD-static CDB-static RAWDatabase-static RAWDatarec-static RAWDatasim-static Root)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
add_subdirectory(ACORDErec)
add_subdirectory(ACORDEsim)
+# DA
+if(DA)
+ add_subdirectory(DA)
+endif(DA)
+
# Install the macros
install(DIRECTORY macros DESTINATION ACORDE)
--- /dev/null
+# **************************************************************************
+# * 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 include folder
+include_directories(${AliRoot_SOURCE_DIR}/ACORDE/DA)
+
+# Additional include folders in alphabetical order
+include_directories(
+ ${AliRoot_SOURCE_DIR}/ACORDE/ACORDEbase
+ ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
+ ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
+ ${AliRoot_SOURCE_DIR}/RAW/dateStream
+ ${AliRoot_SOURCE_DIR}/STEER/ESD
+ )
+
+
+# Sources in alphabetical order
+set(SRCS
+ ACORDEda.cxx
+ )
+
+# DIM
+link_directories(${DIMDIR}/${ODIR})
+
+#daqDA flags
+include_directories(${daqDA})
+link_directories(${daqDA})
+
+# AMORE definitions
+add_definitions(${AMORE_DEFINITIONS})
+
+# Generating the DA executable
+add_executable(ACORDEda ${SRCS})
+
+set(MODULE_COMPILE_FLAGS)
+set(MODULE_LINK_FLAGS)
+
+target_link_libraries(ACORDEda ESD-static RAWDatabase-static RAWDatarec-static ACORDEbase-static ${DATE_MONLIBRARIES} daqDA Root RootExtra ${DATE_RCPROXYLIBRARIES} )
+set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS}")
+set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${AMORE_STATICLIBS} ${AMORE_AUXLIBS}")
+
+# DATE flags
+set_target_properties(ACORDEda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(ACORDEda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# Installation
+install(TARGETS ACORDEda RUNTIME DESTINATION bin)
set(LIBDEPS STEERBase STEER Core Gpad Hist Net RIO Tree XMLParser)
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)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(ANALYSIS-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(ANALYSIS SHARED $<TARGET_OBJECTS:ANALYSIS-object>)
+
+# linking
target_link_libraries(${MODULE} STEERBase Core Gpad Hist Net RIO Tree XMLParser)
# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-fPIC -O -g")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:ANALYSIS-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static STEERBase-static Root)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
# ROOT dictionaries and maps
include(CMakeALICE)
+# Checking first for DIM, DATE, AMORE and daqDA
+# in case ROOT Extra static library needs to be enabled
+
+# DATE
+if(DATE_CONFIG)
+ find_package(DATE)
+endif(DATE_CONFIG)
+
+# daqDA
+if(daqDA)
+ find_package(daqDA)
+endif(daqDA)
+
+# AMORE
+if(AMORE_CONFIG)
+ find_package(AMORE)
+endif(AMORE_CONFIG)
+
+# DA is enabled
+if(DA)
+ if(NOT DIMDIR AND NOT ODIR)
+ set(DA FALSE)
+ message(FATAL_ERROR "Das enabled but no DIMDIR and ODIR set. Please set DIMDIR to DIM installation and ODIR to platform (default linux)")
+ endif()
+
+ if(NOT DATE_FOUND)
+ set(DA FALSE)
+ message(FATAL_ERROR "DAs enabled but no DATE support found. Please point to your date installation using \"DATE_CONFIG\" variable")
+ endif()
+
+ if(NOT daqDA_FOUND)
+ set(DA FALSE)
+ message(FATAL_ERROR "DAs enabled but no daqDA support found. Please point to your daqDA installation using \"daqDA\" variable")
+ endif()
+
+ if(NOT AMORE_FOUND)
+ set(DA FALSE)
+ message(FATAL_ERROR "DAs enabled but no AMORE support found. Please point to your AMORE installation using \"AMORE_CONFIG\" variable")
+ endif()
+
+ # Enable static libraries
+ set(ALIROOT_STATIC TRUE)
+ message(STATUS "DAs enabled")
+endif(DA)
+
# ROOT configuration mandatory
if(ROOTSYS)
find_package(ROOT REQUIRED)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran OPTIONAL)
else()
- message("No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN, etc.")
+ message(STATUS "No Fortran support. Disabling LHAPDF, PHYTIA6, MICROCERN, etc.")
endif()
# DATE
-find_package(DATE)
+if(DATE_CONFIG)
+ find_package(DATE)
+endif(DATE_CONFIG)
+
+# daqDA
+if(daqDA)
+ find_package(daqDA)
+endif(daqDA)
+
+# DA is enabled
+if(DA)
+ if(NOT DATE_FOUND)
+ set(DA FALSE)
+ message(FATAL_ERROR "DAs enabled but no DATE support found. Please point to your date installation using \"DATE_CONFIG\"")
+ endif()
+
+ if(NOT daqDA_FOUND)
+ set(DA FALSE)
+ message(FATAL_ERROR "DAs enabled but no daqDA support found. Please point to your daqDA installation using \"daqDA\" variable")
+ endif()
+
+ # Enable static libraries
+ set(ALIROOT_STATIC TRUE)
+ message(STATUS "DAs enabled")
+endif(DA)
# FastJet
find_package(FASTJET)
add_subdirectory(EMCALrec)
add_subdirectory(EMCALsim)
+if(DA)
+ add_subdirectory(DA)
+endif(DA)
+
# Install the macros, docs
install(DIRECTORY macros DESTINATION ACORDE)
install(DIRECTORY doc DESTINATION ACORDER)
--- /dev/null
+# **************************************************************************
+# * 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 include folder
+include_directories(${AliRoot_SOURCE_DIR}/EMCAL/DA)
+
+# Additional include folders in alphabetical order
+include_directories(
+ ${AliRoot_SOURCE_DIR}/EMCAL/EMCALbase
+ ${AliRoot_SOURCE_DIR}/EMCAL/EMCALUtils
+ ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
+ ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
+ ${AliRoot_SOURCE_DIR}/STEER/ESD
+ ${AliRoot_SOURCE_DIR}/STEER/STEERBase
+ )
+
+# DIM
+link_directories(${DIMDIR}/${ODIR})
+
+#daqDA flags
+include_directories(${daqDA})
+link_directories(${daqDA})
+
+# AMORE definitions
+add_definitions(${AMORE_DEFINITIONS})
+
+# Generating the DA executable
+add_executable(EMCALPEDda EMCALPEDda.cxx)
+add_executable(EMCALLEDda EMCALLEDda.cxx)
+
+set(MODULE_COMPILE_FLAGS)
+set(MODULE_LINK_FLAGS)
+
+target_link_libraries(EMCALPEDda EMCALbase-static RAWDatarec-static RAWDatabase-static STEERBase-static ${DATE_MONLIBRARIES} daqDA Root RootExtra ${DATE_RCPROXYLIBRARIES} )
+target_link_libraries(EMCALLEDda EMCALbase-static RAWDatarec-static RAWDatabase-static STEERBase-static ${DATE_MONLIBRARIES} daqDA Root RootExtra ${DATE_RCPROXYLIBRARIES} )
+
+set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS}")
+set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${AMORE_STATICLIBS} ${AMORE_AUXLIBS}")
+
+# DATE flags
+set_target_properties(EMCALPEDda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(EMCALPEDda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(EMCALLEDda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(EMCALLEDda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# Installation
+install(TARGETS EMCALPEDda EMCALLEDda RUNTIME DESTINATION bin)
set(LIBDEPS STEERBase ESD AOD)
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)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(${MODULE} SHARED $<TARGET_OBJECTS:EMCALUtils-object>)
+target_link_libraries(${MODULE} STEERBase ESD AOD)
# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-O -g -fPIC")
add_definitions(-D__EMCALUTIL__)
# System dependent: Modify the way the library is build
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:EMCALUtils-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static STEERBase-static ESD-static AOD-static Root)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
*/
#include "AliEMCALTriggerData.h"
-#include "AliEMCALTriggerPatch.h"
+//#include "AliEMCALTriggerPatch.h"
#include "AliLog.h"
#include "TIterator.h"
#include "Riostream.h"
#include "AliEMCALTriggerTRUDCSConfig.h"
#include "AliEMCALTriggerSTUDCSConfig.h"
#include "AliEMCALTriggerData.h"
-#include "AliEMCALTriggerPatch.h"
+//#include "AliEMCALTriggerPatch.h"
#include "AliLog.h"
#include "AliRawVEvent.h"
# Additional include folders in alphabetical order except ROOT
include_directories(${ROOT_INCLUDE_DIRS}
${AliRoot_SOURCE_DIR}/EMCAL/EMCALraw
- ${AliRoot_SOURCE_DIR}/EMCAL/EMCALsim
${AliRoot_SOURCE_DIR}/EMCAL/EMCALUtils
${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
# Generate the ROOT map
# Dependecies
-set(LIBDEPS STEERBase STEER CDB ESD RAWDatabase RAWDatarec EMCALUtils EMCALsim)
+set(LIBDEPS STEERBase STEER CDB ESD RAWDatabase RAWDatarec EMCALraw EMCALUtils)
generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(EMCALbase-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(EMCALbase SHARED $<TARGET_OBJECTS:EMCALbase-object>)
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+# dependencies
+target_link_libraries(${MODULE} STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim EMCALraw EMCALUtils)
# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-O -g -fPIC")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:EMCALbase-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static STEERBase-static STEER-static ESD-static CDB-static AOD-static RAWDatabase-static RAWDatarec-static RAWDatasim-static EMCALraw-static EMCALUtils-static Root)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
set(LIBDEPS STEERBase CDB ESD RAWDatabase RAWDatarec EMCALUtils)
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)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(EMCALraw-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(${MODULE} SHARED $<TARGET_OBJECTS:EMCALraw-object>)
+target_link_libraries(${MODULE} STEERBase CDB ESD RAWDatabase RAWDatarec EMCALUtils)
# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-O -g -fPIC")
add_definitions(-D__EMCALUTIL__)
# System dependent: Modify the way the library is build
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:EMCALraw-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static STEERBase-static ESD-static CDB-static RAWDatabase-static RAWDatarec-static EMCALUtils-static Root)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
# **************************************************************************
# HLTbase + subfolders (end of the cmake file)
-# Subfolders hve to be includes at the begining otherwise
+# Subfolders have to be includes at the begining otherwise
# they will inherit properties from the parent
add_subdirectory(HOMER)
add_subdirectory(interface)
set(LIBDEPS STEERBase RAWDatabase AliHLTHOMER)
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)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(HLTbase-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(HLTbase SHARED $<TARGET_OBJECTS:HLTbase-object>)
+target_link_libraries(HLTbase STEERBase RAWDatabase AliHLTHOMER)
# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-fPIC -O -g")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
LIBRARY DESTINATION lib)
install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:HLTbase-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static STEERBase-static RAWDatabase-static AliHLTHOMER-static HLTbase-static Root RootExtra)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
set(LIBDEPS)
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)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(AliHLTHOMER-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(AliHLTHOMER SHARED $<TARGET_OBJECTS:AliHLTHOMER-object>)
# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-fPIC -O -g")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:AliHLTHOMER-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static Root RootExtra)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
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)
-target_link_libraries(${MODULE} ESD STEERBase Core Hist RIO)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(RAWDatabase-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(RAWDatabase SHARED $<TARGET_OBJECTS:RAWDatabase-object>)
+target_link_libraries(RAWDatabase ESD STEERBase)
set(MODULE_COMPILE_FLAGS)
set(MODULE_LINK_FLAGS)
endif(DATE_FOUND)
# Additional compilation and linking flags
-set(MODULE_COMPILE_FLAGS "-O -g ${MODULE_COMPILE_FLAGS}")
+set(MODULE_COMPILE_FLAGS "-fPIC -O -g ${MODULE_COMPILE_FLAGS}")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
set(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}")
endif(${CMAKE_SYSTEM} MATCHES Darwin)
-# Setting target compile and linking flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
+# Setting compilation flags for the object
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
+# Setting the linking flags for the library
set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
# Installation
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:RAWDatabase-object>)
+ target_link_libraries(${MODULE}-static STEERBase-static ESD-static Root)
+
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
set(LIBDEPS ESD RAWDatabase STEERBase Core Net RIO TreePlayer Tree)
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)
-target_link_libraries(${MODULE} STEERBase ESD RAWDatabase Core Net RIO TreePlayer Tree)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(RAWDatarec-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(RAWDatarec SHARED $<TARGET_OBJECTS:RAWDatarec-object>)
+target_link_libraries(RAWDatarec ESD RAWDatabase STEERBase Core Net RIO TreePlayer Tree)
# Compile and link flags
set(MODULE_COMPILE_FLAGS)
endif(DATE_FOUND)
# Additional compilation and linking flags
-set(MODULE_COMPILE_FLAGS "-O -g ${MODULE_COMPILE_FLAGS}")
+set(MODULE_COMPILE_FLAGS "-fPIC -O -g ${MODULE_COMPILE_FLAGS}")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
set(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}")
endif(${CMAKE_SYSTEM} MATCHES Darwin)
-# Setting target compile and linking flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
+# Setting compile flags for the object
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
+
+# Setting linking flags for the library
set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
# Installation
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:RAWDatarec-object>)
+ target_link_libraries(${MODULE}-static STEERBase-static RAWDatabase-static ESD-static Root)
+
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
set(LIBDEPS RAWDatabase STEERBase STEER Core)
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)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(RAWDatasim-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(RAWDatasim SHARED $<TARGET_OBJECTS:RAWDatasim-object>)
target_link_libraries(${MODULE} RAWDatabase STEERBase STEER Core)
# Compile and link flags
endif(DATE_FOUND)
# Additional compilation and linking flags
-set(MODULE_COMPILE_FLAGS "-O -g ${MODULE_COMPILE_FLAGS}")
+set(MODULE_COMPILE_FLAGS "-fPIC -O -g ${MODULE_COMPILE_FLAGS}")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
set(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}")
endif(${CMAKE_SYSTEM} MATCHES Darwin)
-# Setting target compile and linking flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
-set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
-
+# Setting target compile for the object
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
+# Setting linking flags for the library
+set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
# Installation
install(TARGETS ${MODULE}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:RAWDatasim-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static RAWDatabase-static STEERBase-static STEER-static Root)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
set(LIBDEPS ${ROOT_DEPENDENCIES} ${ALIROOT_DEPENDENCIES})
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)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(${MODULE} SHARED $<TARGET_OBJECTS:AOD-object>)
+
+# library dependecies
target_link_libraries(${MODULE} ${ROOT_DEPENDENCIES} ${ALIROOT_DEPENDENCIES})
# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-O -g -fPIC")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:AOD-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static STEERBase-static ESD-static Root)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
set(LIBDEPS STEERBase Core GenVector Gpad Graf Gui Hist MathCore Matrix Minuit Net RIO Tree XMLParser)
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)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(CDB-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(CDB SHARED $<TARGET_OBJECTS:CDB-object>)
+
+# Linking library
target_link_libraries(${MODULE} STEERBase Core GenVector Gpad Graf Gui Hist MathCore Matrix Minuit Net RIO Tree XMLParser)
# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-fPIC -O -g")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:CDB-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static STEERBase-static Root)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
# 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_dictionary("ESD" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
# Generate the ROOT map
# Dependecies
set(LIBDEPS STEERBase Core EG Geom Gpad Graf3d MathCore Matrix Physics RIO Tree)
-generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+generate_rootmap("ESD" "${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)
-target_link_libraries(${MODULE} STEERBase Core EG Geom Gpad Graf3d MathCore Matrix Physics RIO Tree)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(ESD-object OBJECT ${SRCS} G__${MODULE}.cxx)
-# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+# Add a library to the project using the object
+add_library(ESD SHARED $<TARGET_OBJECTS:ESD-object>)
+target_link_libraries(ESD STEERBase Core EG Geom Gpad Graf3d MathCore Matrix Physics RIO Tree)
+
+# Additional compilation flags for the object
+set_target_properties(ESD-object PROPERTIES COMPILE_FLAGS "-fPIC -O -g")
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
- set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+ set_target_properties(ESD PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(${CMAKE_SYSTEM} MATCHES Darwin)
# Installation
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:ESD-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+ target_link_libraries(${MODULE}-static STEERBase-static Root)
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
# Generate the ROOT map
# Dependecies
-set(LIBDEPS STEERBase RAWDatabase RAWDatarec CDB ESD Core EG GenVector GeomPainter Geom Gpad Graf Hist MathCore Matrix Minuit Net Physics Proof RIO Tree VMC)
+set(LIBDEPS STEERBase RAWDatabase RAWDatarec CDB ESD ANALYSIS HLTbase Core EG GenVector GeomPainter Geom Gpad Graf Hist MathCore Matrix Minuit Net Physics Proof RIO Tree VMC)
generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
set(LIBHLTSIM_VERSION "1")
add_definitions("-DLIBHLTSIM_VERSION=${LIBHLTSIM_VERSION}")
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(STEER-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(STEER SHARED $<TARGET_OBJECTS:STEER-object>)
# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-fPIC -O -g")
target_link_libraries(${MODULE} STEERBase RAWDatabase RAWDatarec CDB ESD ANALYSIS HLTbase Core EG GenVector GeomPainter Geom Gpad Graf Hist MathCore Matrix Minuit Net Physics Proof RIO Tree VMC)
# System dependent: Modify the way the library is build
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:STEER-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ target_link_libraries(${MODULE}-static STEERBase-static RAWDatabase-static RAWDatarec-static CDB-static ESD-static ANALYSIS-static HLTbase-static Root)
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
get_directory_property(incdirs INCLUDE_DIRECTORIES)
generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+# Create an object to be reused in case of static libraries
+# Otherwise the sources will be compiled twice
+add_library(STEERBase-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(STEERBase SHARED $<TARGET_OBJECTS:STEERBase-object>)
# Generate the ROOT map
# Dependecies
set(LIBDEPS Core EG Geom Gpad Graf3d Graf Hist MathCore Matrix Minuit Net Physics RIO Tree VMC)
-generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+generate_rootmap("STEERBase" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
-# Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
-target_link_libraries(${MODULE} Core EG Geom Gpad Graf3d Graf Hist MathCore Matrix Minuit Net Physics RIO Tree VMC)
+# Additional compilation flags for the object
+set_target_properties(STEERBase-object PROPERTIES COMPILE_FLAGS "-fPIC -O -g")
+# Linking the library, not the object
+target_link_libraries(STEERBase Core EG Geom Gpad Graf3d Graf Hist MathCore Matrix Minuit Net Physics RIO Tree VMC)
# System dependent: Modify the way the library is build
if(${CMAKE_SYSTEM} MATCHES Darwin)
- set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+ set_target_properties(STEERBase PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif(${CMAKE_SYSTEM} MATCHES Darwin)
# Installation
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+ add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:STEERBase-object>)
+ set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+ set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+ target_link_libraries(${MODULE}-static Root)
+
+ # Installation
+ install(TARGETS ${MODULE}-static
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
-# AliRoot Build System Module to find and configure AMORE
-#
-# Author: Johny Jose (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)
+# AMORE - used to generate the DAs
+# Flags are filled using amore-config
+# - AMORE_VERSION
+# - AMORE_STATICLIBS - libraries and linking folders for static build
+# - AMORE_AUXLIBS - auxiliary libraries for DA
+# - AMORE_DEFINITIONS
+
+set(AMORE_FOUND FALSE)
-find_program(AMORE_CONFIG NAMES amore-config)
if(AMORE_CONFIG)
- set(AMORE_FOUND TRUE)
- set(AMOREDEFINITIONS "-DALI_AMORE")
- execute_process(COMMAND ${AMORE_CONFIG} --cflags --includes OUTPUT_VARIABLE AMOREFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${AMORE_CONFIG} --ldflags --ldflags-da-static --libs OUTPUT_VARIABLE _lddaflags OUTPUT_STRIP_TRAILING_WHITESPACE)
- ALICE_CleanOutput(_lddaflags "${_lddaflags}")
- set(AMOREFLAGS "-DALI_AMORE ${AMOREFLAGS}")
- if(DATE_FOUND)
- execute_process(COMMAND ${DATE_CONFIG} --rcproxylibs OUTPUT_VARIABLE _rcproxylib OUTPUT_STRIP_TRAILING_WHITESPACE)
- else()
- message(STATUS "AMORE requires DATE")
- endif(DATE_FOUND)
- set(AMOREDALIBS "-static ${_lddaflags} ${_rcproxylib}")
- else()
- message(STATUS "AMORE not found")
+ # Checking AMORE version
+ execute_process(COMMAND ${AMORE_CONFIG} --version OUTPUT_VARIABLE AMORE_VERSION ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+ if(error)
+ message(FATAL_ERROR "Error retrieving AMORE version : ${error}")
+ endif(error)
+ string(STRIP ${AMORE_VERSION} AMORE_VERSION)
+
+ # Extract major, minor, and patch versions from
+# string(REGEX REPLACE "^([0-9]+)\\.[0-9]+" "\\1" DATE_VERSION_MAJOR "${DATE_VERSION}")
+# string(REGEX REPLACE "^[0-9]+\\.([0-9]+)" "\\1" DATE_VERSION_MINOR "${DATE_VERSION}")
+ message(STATUS "AMORE version ${AMORE_VERSION} found.")
+
+ # Checking AMORE static libraries
+ execute_process(COMMAND ${AMORE_CONFIG} --ldflags-da-static OUTPUT_VARIABLE AMORE_STATICLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+ if(error)
+ message(FATAL_ERROR "Error retrieving AMORE static libraries : ${error}")
+ endif(error)
+ string(STRIP ${AMORE_STATICLIBS} AMORE_STATICLIBS)
+ string(REPLACE "\n" " " AMORE_STATICLIBS ${AMORE_STATICLIBS})
+
+ # Checking AMORE auxiliary libraries
+ execute_process(COMMAND ${AMORE_CONFIG} --auxlibs OUTPUT_VARIABLE AMORE_AUXLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+ if(error)
+ message(FATAL_ERROR "Error retrieving AMORE auxiliary libraries : ${error}")
+ endif(error)
+ string(STRIP ${AMORE_AUXLIBS} AMORE_AUXLIBS)
+
+ set(AMORE_DEFINITIONS "-DALI_AMORE")
+ set(AMORE_FOUND TRUE)
+
endif(AMORE_CONFIG)
# - DATE_CONFIG - path to date-config script
# - DATE_CFLAGS - cflags reported by date-config
# - DATE_LDFLAGS - ldflags reported by date-config
-# - DATE_LIBS - DATE libs to be linked against to
-# - DATE_MONLIBS - monitorlibs reported by date-config
+# - DATE_LIBS - DATE libs to be linked against to reported by date-config --libs
+# - DATE_LIBRARIES - DATE libs as as list as extracted from date-config --libs
+# - DATE_MONLIBS - monitorlibs reported by date-config --monitorlibs
+# - DATE_MONLIBRARIES - DATE monitor libs as a list extracted from the date-config --monitorlibs
+# - DATE_STATICMON - DATE static monitor libs needed by the DA
+# - DATE_RCPROXYLIBS - rcproxylibs reported by date-config --rcproxylibs
+# - DATE_RCPROXYLIBRARIES - rcproxylibs as a list as extracted from date-config --rcproxylibs
-find_program(DATE_CONFIG date-config)
+#########################
+# Functions definitions
+#########################
+# A function to find all the libraries listed in library_list. The list contains the short
+# names of libraries (ie. Db instead of libDb.so).
+# Libraries are search in library_paths.
+# It returns the list of libraries, with full path and full name.
+# Author: Barthelemy Von Haller
+function(find_date_libraries _output library_list library_paths)
+ FOREACH (LIB ${library_list})
+ # Find first static, this is used by the DA
+ find_library(DATE_LIBRARY_${LIB} NAMES "lib${LIB}.a" PATHS ${library_paths})
+
+ if(NOT DATE_LIBRARY_${LIB})
+ find_library(DATE_LIBRARY_${LIB} NAMES ${LIB} PATHS ${library_paths})
+ endif()
+
+ mark_as_advanced(DATE_LIBRARY_${LIB})
+ set(_output_tmp ${_output_tmp} ${DATE_LIBRARY_${LIB}})
+ ENDFOREACH (LIB ${library_list})
+
+ set(${_output} ${_output_tmp} PARENT_SCOPE)
+endfunction(find_date_libraries _output library_list library_paths)
+
+# DATE_CONFIG set from the configuration
if(DATE_CONFIG)
# Checking DATE version
execute_process(COMMAND ${DATE_CONFIG} --version OUTPUT_VARIABLE DATE_VERSION ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)" "\\1" DATE_VERSION_MINOR "${DATE_VERSION}")
message(STATUS "DATE version ${DATE_VERSION_MAJOR}.${DATE_VERSION_MINOR} found.")
- # Checking if the environment is properly set
-# if(NOT DEFINED ENV{DATE_ROOT})
-# message(FATAL_ERROR "date-config found. Please set DATE_ROOT environment variable")
-# else()
-# set(DATE_ROOT ENV{DATE_ROOT})
-# message(STATUS "DATE_ROOT found ${DATE_ROOT}")
-# endif()
-
-# if(NOT DEFINED ENV{DATE_COMMON_DEFS})
-# message(FATAL_ERROR "date-config found. Please set DATE_COMMON_DEFS environment variable")
-# else()
-# set(DATE_COMMON_DEFS ENV{DATE_COMMON_DEFS})
-# message(STATUS "DATE_COMMON_DEFS found ${DATE_COMMON_DEFS}")
-# endif()
-
-# if(NOT DEFINED ENV{DATE_MONITOR_DIR})
-# message(FATAL_ERROR "date-config found. Please set DATE_MONITOR_DIR environment variable")
-# else()
-# set(DATE_MONITOR_DIR ENV{DATE_MONITOR_DIR})
-# message(STATUS "DATE_MONITOR_DIR found ${DATE_MONITOR_DIR}")
-# endif()
-
# setting the cflags
execute_process(COMMAND ${DATE_CONFIG} --cflags OUTPUT_VARIABLE DATE_CFLAGS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
string(STRIP ${DATE_LIBS} DATE_LIBS)
endif()
+ # DATE_LIBRARIES
+ # Extracting the list of dynamic and static libraries from the --libs
+ # The list is needed during the generation of the DAs
+ # using a find_library in order to get the full path and not need to use -L during linking of the DAs
+ string(REGEX MATCHALL "[-]l[^- ]+" DATE_LIBRARIES_TMP ${DATE_LIBS})
+ string(REGEX REPLACE "[-]l" ";" DATE_LIBRARIES_TMP ${DATE_LIBRARIES_TMP})
+ # Get the list of search path using -Lyyy -> yyy
+ string(REGEX MATCHALL "[-]L[^- ]+" DATE_LIBRARIES_PATH_TMP ${DATE_LIBS})
+ string(REGEX REPLACE "[-]L" ";" DATE_LIBRARIES_PATH_TMP ${DATE_LIBRARIES_PATH_TMP})
+ find_date_libraries(DATE_LIBRARIES "${DATE_LIBRARIES_TMP}" "${DATE_LIBRARIES_PATH_TMP}")
+ message(STATUS "DATE LIBs ${DATE_LIBRARIES}")
+
+ # Fix for mysql bug https://bugs.launchpad.net/percona-server/+bug/1287374
+ set(DATE_LIBS "${DATE_LIBS} -L/usr/lib64/mysql/")
+
# setting the monlibs
- execute_process(COMMAND ${DATE_CONFIG} --monitorlibs OUTPUT_VARIABLE DATE_MONLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+ execute_process(COMMAND ${DATE_CONFIG} --monitorlibs=noshift OUTPUT_VARIABLE DATE_MONLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error retrieving DATE monitorlibs : ${error}")
endif(error)
string(STRIP ${DATE_MONLIBS} DATE_MONLIBS)
endif()
+ # DATE_MONLIBRARIES
+ # Extracting the list of dynamic and static libraries from the --libs
+ # The list is needed during the generation of the DAs
+ # Removing everything that starts with - to leave all the static libraries
+ # Replacing space with ; to create a list that will be sent to the linked
+ string(REGEX REPLACE "-[^ \r\n\t].+( |$)?" "" DATE_STATICMON ${DATE_MONLIBS})
+ if(DATE_STATICMON)
+ string(REPLACE " " ";" DATE_STATICMON ${DATE_STATICMON})
+ endif(DATE_STATICMON)
+
+ # Extracting all the shared libraries
+ # using a find_library in order to get the full path and not need to use -L during linking of the DAs
+ string(REGEX MATCHALL "[-]l[^- ]+" DATE_MONLIBRARIES_TMP ${DATE_MONLIBS})
+ string(REGEX REPLACE "[-]l" ";" DATE_MONLIBRARIES_TMP ${DATE_MONLIBRARIES_TMP})
+ # Get the list of search path using -Lyyy -> yyy
+ string(REGEX MATCHALL "[-]L[^- ]+" DATE_MONLIBRARIES_PATH_TMP ${DATE_MONLIBS})
+ string(REGEX REPLACE "[-]L" ";" DATE_MONLIBRARIES_PATH_TMP ${DATE_MONLIBRARIES_PATH_TMP})
+ find_date_libraries(DATE_MONLIBRARIES "${DATE_MONLIBRARIES_TMP}" "${DATE_MONLIBRARIES_PATH_TMP}")
+ set(DATE_MONLIBRARIES ${DATE_STATICMON} ${DATE_MONLIBRARIES})
+ message(STATUS "MONSTATIC ${DATE_STATICMON}")
+
+ # Fix for mysql bug https://bugs.launchpad.net/percona-server/+bug/1287374
+ set(DATE_MONLIBS "${DATE_MONLIBS} -L/usr/lib64/mysql/")
+
+ # setting the monlibs
+ execute_process(COMMAND ${DATE_CONFIG} --rcproxylibs OUTPUT_VARIABLE DATE_RCPROXYLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+ if(error)
+ message(FATAL_ERROR "Error retrieving DATE rcproxylibs")
+ endif(error)
+
+ # If the flags are not empty we strip them
+ if(DATE_RCPROXYLIBS)
+ string(STRIP ${DATE_RCPROXYLIBS} DATE_RCPROXYLIBS)
+ endif()
+
+ # DATE_LIBRARIES
+ # Extracting the list of dynamic and static libraries from the --libs
+ # The list is needed during the generation of the DAs
+ string(REGEX MATCHALL "[-]l[^- ]+" DATE_RCPROXYLIBRARIES_TMP ${DATE_RCPROXYLIBS})
+ string(REGEX REPLACE "[-]l" ";" DATE_RCPROXYLIBRARIES_TMP ${DATE_RCPROXYLIBRARIES_TMP})
+ # Get the list of search path using -Lyyy -> yyy
+ string(REGEX MATCHALL "[-]L[^- ]+" DATE_RCPROXYLIBRARIES_PATH_TMP ${DATE_RCPROXYLIBS})
+ string(REGEX REPLACE "[-]L" ";" DATE_RCPROXYLIBRARIES_PATH_TMP ${DATE_RCPROXYLIBRARIES_PATH_TMP})
+ find_date_libraries(DATE_RCPROXYLIBRARIES "${DATE_RCPROXYLIBRARIES_TMP}" "${DATE_RCPROXYLIBRARIES_PATH_TMP}")
+ message(STATUS "DATE RCLIBs ${DATE_RCPROXYLIBRARIES}")
+
set(DATE_FOUND TRUE)
else()
message(STATUS "DATE not found")
-
-# set(DATEFLAGS "-D${CMAKE_SYSTEM_NAME} -DDATE_SYS=${CMAKE_SYSTEM_NAME} -Dlong32='int' -Dlong64='long long' -DdatePointer='long'")
endif(DATE_CONFIG)
link_directories(${ROOT_LIBDIR})
include_directories(${ROOT_INCLUDE_DIR})
set(ROOT_FOUND TRUE)
+
+ # Workaround misssing XML, VMC, Minuit from ROOT static library
+ # Also adding libzma.a libfreetype.a libpcre.a
+ # To be removed where https://sft.its.cern.ch/jira/browse/ROOT-6904 issue is fixed
+ if(ALIROOT_STATIC)
+ message(WARNING "AliRoot static build enabled! libRootExtra.a will be created.\nPlease remove when ROOT https://sft.its.cern.ch/jira/browse/ROOT-6904 issue is fixed")
+
+ # ROOT needs xml2 but it is not build with the static version so we have to add it
+ find_package(LibXml2)
+
+ if(LIBXML2_FOUND)
+
+ # adding SSL
+ find_package(OpenSSL)
+
+ if(OPENSSL_FOUND)
+ file(GLOB _extraroot "${ROOTSYS}/montercarlo/vmc/src/*.o" "${ROOTSYS}/tree/treeplayer/src/*.o" "${ROOTSYS}/io/xmlparser/src/*.o" "${ROOTSYS}/math/minuit2/src/*.o")
+ add_library(RootExtra STATIC ${_extraroot})
+ set_target_properties(RootExtra PROPERTIES COMPILE_FLAGS "${LIBXML2_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR}")
+ set_target_properties(RootExtra PROPERTIES LINKER_LANGUAGE CXX)
+ target_link_libraries(RootExtra ${ROOT_LIBDIR}/libfreetype.a ${ROOT_LIBDIR}/libpcre.a ${ROOT_LIBDIR}/liblzma.a ${LIBXML2_LIBRARIES} ${OPENSSL_LIBRARIES})
+ else()
+ message(FATAL_ERROR "OpenSSL not found. Coould not generate the static RootExtra. Please install Openssl")
+ endif()
+ else()
+ message(FATAL_ERROR "libxml2 not found. Can not generate the static RootExtra. Please install libxml2")
+ endif()
+ endif(ALIROOT_STATIC)
else()
message(FATAL_ERROR "ROOT installation not found! Please point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR.")
endif(ROOTSYS)
\ No newline at end of file
--- /dev/null
+# **************************************************************************
+# * 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. *
+# **************************************************************************
+
+# Check for daqDA library in order to build detectors DA
+
+set(daqDA_FOUND false)
+
+if(daqDA)
+ # Check for header
+ find_path(DAQDAH daqDA.h PATHS ${daqDA})
+
+ if(DAQDAH-NOTFOUND)
+ message(FATAL_ERROR "daqDA enabled but daqDA.h not found. Please check that daqDA points to your installation")
+ endif(DAQDAH-NOTFOUND)
+
+ find_path(DAQDALIB libdaqDA.a PATHS ${daqDA})
+
+ if(DAQDALIB-NOTFOUND)
+ message(FATAL_ERROR "daqDA enabled but libdaqDA.a not found. Please check that daqDA points to your installation")
+ endif(DAQDALIB-NOTFOUND)
+
+ set(daqDA_FOUND TRUE)
+endif(daqDA)
\ No newline at end of file