Remove circular dependecy in Base + initial DAs
authoragrigora <alina.grigoras@cern.ch>
Tue, 25 Nov 2014 09:07:29 +0000 (10:07 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:52:00 +0000 (13:52 +0100)
17 files changed:
T0/DA/CMakeLists.txt
TOF/DA/CMakeLists.txt [new file with mode: 0644]
TOF/DA/TOFcalibda.cxx [moved from TOF/TOFcalibda.cxx with 100% similarity]
TOF/DA/TOFda.cxx [moved from TOF/TOFda.cxx with 100% similarity]
TOF/DA/TOFnoiseda.cxx [moved from TOF/TOFnoiseda.cxx with 100% similarity]
TOF/DA/TOFphysicsda.cxx [moved from TOF/TOFphysicsda.cxx with 100% similarity]
TOF/DA/TOFpulserda.cxx [moved from TOF/TOFpulserda.cxx with 100% similarity]
TOF/TOFbase/AliTOFRecoParam.cxx [moved from TOF/TOFrec/AliTOFRecoParam.cxx with 100% similarity]
TOF/TOFbase/AliTOFRecoParam.h [moved from TOF/TOFrec/AliTOFRecoParam.h with 100% similarity]
TOF/TOFbase/AliTOFSDigit.cxx [moved from TOF/TOFsim/AliTOFSDigit.cxx with 100% similarity]
TOF/TOFbase/AliTOFSDigit.h [moved from TOF/TOFsim/AliTOFSDigit.h with 100% similarity]
TOF/TOFbase/CMakeLists.txt
TOF/TOFbase/TOFbaseLinkDef.h
TOF/TOFrec/CMakeLists.txt
TOF/TOFrec/TOFrecLinkDef.h
TOF/TOFsim/CMakeLists.txt
TOF/TOFsim/TOFsimLinkDef.h

index bc3655c..641bf55 100644 (file)
@@ -62,7 +62,7 @@ set_target_properties(T0Laserda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS}
 set_target_properties(T0Laserda PMDPEDESTALda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
 
 set_target_properties(T0Physda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
-set_target_properties(T0Physda PMDPEDESTALda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+set_target_properties(T0Physda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
 
 # Installation
 install(TARGETS T0Cosmicda T0Laserda T0Physda RUNTIME DESTINATION bin)
\ No newline at end of file
diff --git a/TOF/DA/CMakeLists.txt b/TOF/DA/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6b432cc
--- /dev/null
@@ -0,0 +1,81 @@
+# **************************************************************************
+# * 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}/TOF/DA)
+
+# Additional include folders in alphabetical order
+include_directories(
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
+                    ${AliRoot_SOURCE_DIR}/STEER/ESD
+                    ${AliRoot_SOURCE_DIR}/STEER/STEER
+                    ${AliRoot_SOURCE_DIR}/STEER/STEERBase
+                   )
+
+
+# DIM
+link_directories(${DIMDIR}/${ODIR})
+
+#daqDA flags
+include_directories(${daqDA})
+link_directories(${daqDA})
+
+# AMORE definitions
+add_definitions(${AMORE_DEFINITIONS})
+include_directories(${AMORE_INCLUDE_DIR})
+
+# Generating the DA executable
+add_executable(TOFcalibda TOFcalibda.cxx) # 1
+add_executable(TOFda TOFda.cxx) # 2
+add_executable(TOFnoiseda TOFnoiseda.cxx) # 3
+add_executable(TOFphysicsda TOFphysicsda.cxx) # 4
+add_executable(TOFpulserda TOFpulserda.cxx) # 5
+
+set(MODULE_COMPILE_FLAGS)
+set(MODULE_LINK_FLAGS)
+
+target_link_libraries(TOFcalibda RAWDatarec-static STEERBase-static TOFbase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 1
+target_link_libraries(TOFda RAWDatarec-static STEERBase-static TOFbase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 2
+target_link_libraries(TOFnoiseda RAWDatarec-static STEERBase-static TOFbase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 3
+target_link_libraries(TOFphysicsda RAWDatarec-static STEERBase-static TOFbase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 4
+target_link_libraries(TOFpulserda RAWDatarec-static STEERBase-static TOFbase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 5
+
+# different flags
+set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS} ${AMORE_CFLAGS}")
+set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${AMORE_STATICLIBS}")
+
+set_target_properties(TOFcalibda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(TOFcalibda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(TOFda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(TOFda PMDPEDESTALda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(TOFnoiseda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(TOFnoiseda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(TOFphysicsda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(TOFphysicsda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(TOFpulserda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(TOFpulserda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# Installation
+install(TARGETS TOFcalibda
+                TOFda
+                TOFnoiseda
+                TOFphysicsda
+                TOFpulserda
+        RUNTIME DESTINATION bin)
\ No newline at end of file
similarity index 100%
rename from TOF/TOFcalibda.cxx
rename to TOF/DA/TOFcalibda.cxx
similarity index 100%
rename from TOF/TOFda.cxx
rename to TOF/DA/TOFda.cxx
similarity index 100%
rename from TOF/TOFnoiseda.cxx
rename to TOF/DA/TOFnoiseda.cxx
similarity index 100%
rename from TOF/TOFphysicsda.cxx
rename to TOF/DA/TOFphysicsda.cxx
similarity index 100%
rename from TOF/TOFpulserda.cxx
rename to TOF/DA/TOFpulserda.cxx
index a841718..a4058d1 100644 (file)
@@ -28,8 +28,6 @@ include_directories(${ROOT_INCLUDE_DIRS}
                     ${AliRoot_SOURCE_DIR}/STEER/ESD
                     ${AliRoot_SOURCE_DIR}/STEER/STEER
                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase
-                    ${AliRoot_SOURCE_DIR}/TOF/TOFrec
-                    ${AliRoot_SOURCE_DIR}/TOF/TOFsim
                    )
 
 # Sources in alphabetical order
@@ -72,8 +70,10 @@ set(SRCS
     AliTOFRawMap.cxx
     AliTOFRawStream.cxx
     AliTOFReadoutInfo.cxx
+    AliTOFRecoParam.cxx
     AliTOFResponseParams.cxx
     AliTOFRunParams.cxx
+    AliTOFSDigit.cxx
     AliTOFT0Fill.cxx
     AliTOFT0FillOnlineCalib.cxx
     AliTOFTDCErrorBuffer.cxx
@@ -91,17 +91,25 @@ string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
+set(ROOT_DEPENDENCIES )
+set(ALIROOT_DEPENDENCIES STEERBase STEER ESD CDB RAWDatabase RAWDatarec RAWDatasim)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS STEERBase STEER ESD CDB RAWDatabase RAWDatarec RAWDatasim TOFrec TOFsim)
+set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
 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(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(${MODULE} SHARED $<TARGET_OBJECTS:TOFbase-object>)
 
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+# Linking
+target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_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)
@@ -113,4 +121,20 @@ 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:TOFbase-object>)
+    set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+
+    # list of shared dependencies / the name of the variable containing the list of static ones
+    generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
+    target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} 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)
index 87c2d6d..17f63ce 100644 (file)
@@ -44,6 +44,8 @@
 #pragma link C++ class  AliTOFT0FillOnlineCalib+;
 #pragma link C++ class  AliTOFDCSmaps+;
 #pragma link C++ class  AliTOFLvHvDataPoints+;
+#pragma link C++ class  AliTOFRecoParam+;
+#pragma link C++ class  AliTOFSDigit+;
 
 #pragma link C++ class  AliTOFChainSummaryData+;
 #pragma link C++ class  AliTOFDRMSummaryData+;
index b41df2b..e8ec72e 100644 (file)
@@ -38,7 +38,6 @@ set(SRCS
     AliTOFClusterFinderV1.cxx
     AliTOFQADataMakerRec.cxx
     AliTOFReconstructor.cxx
-    AliTOFRecoParam.cxx
     AliTOFT0maker.cxx
     AliTOFT0v1.cxx
     AliTOFtrack.cxx
index bedd8cd..ab54ac0 100644 (file)
@@ -17,7 +17,6 @@
 #pragma link C++ class  AliTOFtrackerV1+;
 #pragma link C++ class  AliTOFtrackerV2+;
 #pragma link C++ class  AliTOFReconstructor+;
-#pragma link C++ class  AliTOFRecoParam+;
 #pragma link C++ class  AliTOFQADataMakerRec+;
 #pragma link C++ class  AliTOFT0v1+;
 #pragma link C++ class  AliTOFT0maker+;
index 543e7e9..b8656b9 100644 (file)
@@ -42,7 +42,6 @@ set(SRCS
     AliTOFhitT0.cxx
     AliTOFQAChecker.cxx
     AliTOFQADataMakerSim.cxx
-    AliTOFSDigit.cxx
     AliTOFSDigitizer.cxx
     AliTOFT0.cxx
     AliTOFTrigger.cxx
index 260ce58..8656b49 100644 (file)
@@ -14,7 +14,6 @@
 #pragma link C++ class  AliTOFhitT0+;
 
 #pragma link C++ class  AliTOFHitMap+;
-#pragma link C++ class  AliTOFSDigit+;
 #pragma link C++ class  AliTOFSDigitizer+;
 #pragma link C++ class  AliTOFDigitizer+;