ITS DAs
authoragrigora <alina.grigoras@cern.ch>
Mon, 24 Nov 2014 14:10:12 +0000 (15:10 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:51:59 +0000 (13:51 +0100)
ITS/CMakeLists.txt
ITS/DA/CMakeLists.txt
ITS/ITSbase/CMakeLists.txt
ITS/ITSrec/CMakeLists.txt
ITS/ITSsim/CMakeLists.txt

index ba03900..4e05e4a 100644 (file)
@@ -18,6 +18,10 @@ add_subdirectory(ITSrec)
 add_subdirectory(ITSsim)
 add_subdirectory(UPGRADE)
 
+if(DA)
+    add_subdirectory(DA)
+endif(DA)
+
 # Macros
 install(DIRECTORY oldmacros DESTINATION ITS)
 install(DIRECTORY macrosSDD DESTINATION ITS)
index c89898d..2e423bb 100644 (file)
@@ -18,6 +18,13 @@ include_directories(${AliRoot_SOURCE_DIR}/HMPID/DA)
 
 # Additional include folders in alphabetical order
 include_directories(
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
+                    ${AliRoot_SOURCE_DIR}/ITS/ITSbase
+                    ${AliRoot_SOURCE_DIR}/ITS/ITSrec
+                    ${AliRoot_SOURCE_DIR}/STEER/CDB
+                    ${AliRoot_SOURCE_DIR}/STEER/ESD
+                    ${AliRoot_SOURCE_DIR}/STEER/STEERBase
                    )
 
 
@@ -33,36 +40,71 @@ add_definitions(${AMORE_DEFINITIONS})
 include_directories(${AMORE_INCLUDE_DIR})
 
 # Generating the DA executable
-add_executable(ITSSDDBASda ITSSDDBASda.cxx)
-add_executable(ITSSDDGAINda ITSSDDGAINda.cxx)
-add_executable(ITSSDDINJda ITSSDDINJda.cxx)
-add_executable(ITSSPDFOda ITSSPDFOda.cxx)
-add_executable(ITSSPDPHYSda ITSSPDPHYSda.cxx)
-add_executable(ITSSPDSCANda ITSSPDSCANda.cxx)
-add_executable(ITSSPDVertexDiamondda ITSSPDVertexDiamondda.cxx)
-add_executable(ITSSSDPEDda ITSSSDPEDda.cxx)
+add_executable(ITSSDDBASda ITSSDDBASda.cxx) # 1
+add_executable(ITSSDDGAINda ITSSDDGAINda.cxx) # 2
+add_executable(ITSSDDINJda ITSSDDINJda.cxx) # 3
+add_executable(ITSSPDFOda ITSSPDFOda.cxx) # 4
+add_executable(ITSSPDPHYSda ITSSPDPHYSda.cxx) # 5
+add_executable(ITSSPDSCANda ITSSPDSCANda.cxx) # 6
+add_executable(ITSSPDVertexDiamondda ITSSPDVertexDiamondda.cxx) # 7
+add_executable(ITSSSDPEDda ITSSSDPEDda.cxx) # 8
 
 set(MODULE_COMPILE_FLAGS)
 set(MODULE_LINK_FLAGS)
 
-target_link_libraries(ITSSDDBASda ITSrec-static ITSbase-static RAWDatarec-static RAWDatarecOnline-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra)
-target_link_libraries(ITSSDDGAINda ITSrec-static ITSbase-static RAWDatarec-static RAWDatarecOnline-static  ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra)
-target_link_libraries(ITSSDDINJda ITSrec-static ITSbase-static RAWDatarec-static RAWDatarecOnline-static  ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra)
-target_link_libraries(ITSSPDFOda ITSrec-static ITSbase-static HLTrec-static RAWDatarec-static RAWDatarecOnline-static STEERBase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra)
-target_link_libraries(ITSSPDPHYSda ITSrec-static ITSbase-static HLTrec-static RAWDatarec-static RAWDatarecOnline-static STEERBase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra)
-target_link_libraries(ITSSPDSCANda ITSrec-static ITSbase-static HLTrec-static RAWDatarec-static RAWDatarecOnline-static STEERBase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra
-target_link_libraries(ITSSPDVertexDiamondda ITSrec-static ITSbase-static HLTrec-static RAWDatarec-static RAWDatarecOnline-static STEERBase-static CDB-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra
-target_link_libraries(ITSSDDBASda ITSbase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra)
+target_link_libraries(ITSSDDBASda ITSbase ITSrec RAWDatarec ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 1
+target_link_libraries(ITSSDDGAINda ITSrec-static ITSbase-static RAWDatarec-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 2
+target_link_libraries(ITSSDDINJda ITSrec-static ITSbase-static RAWDatarec-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 3
+target_link_libraries(ITSSPDFOda ITSrec-static ITSbase-static RAWDatarec-static STEERBase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 4
+target_link_libraries(ITSSPDPHYSda ITSrec-static ITSbase-static RAWDatarec-static STEERBase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 5
+target_link_libraries(ITSSPDSCANda ITSrec-static ITSbase-static RAWDatarec-static STEERBase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 6
+target_link_libraries(ITSSPDVertexDiamondda ITSrec-static RAWDatarec-static STEERBase-static CDB-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 7
+target_link_libraries(ITSSSDPEDda ITSbase-static ${AMORE_AUXLIBS} daqDA ${DATE_MONLIBRARIES} ${DATE_RCPROXYLIBRARIES} Root RootExtra) # 8
 
 # different flags
 set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS} ${AMORE_CFLAGS}")
 set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${AMORE_STATICLIBS}")
 
-set_target_properties(HMPIDda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
-set_target_properties(HMPIDda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+# 1
+set_target_properties(ITSSDDBASda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(ITSSDDBASda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# 2
+set_target_properties(ITSSDDGAINda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(ITSSDDGAINda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# 3
+set_target_properties(ITSSDDINJda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(ITSSDDINJda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# 4
+set_target_properties(ITSSPDFOda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(ITSSPDFOda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# 5
+set_target_properties(ITSSPDPHYSda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(ITSSPDPHYSda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# 6
+set_target_properties(ITSSPDSCANda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(ITSSPDSCANda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# 7
+set_target_properties(ITSSPDVertexDiamondda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(ITSSPDVertexDiamondda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# 8
+set_target_properties(ITSSSDPEDda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(ITSSSDPEDda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
 
-set_target_properties(HMPIDphysda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
-set_target_properties(HMPIDphysda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
 
 # Installation
-install(TARGETS HMPIDda HMPIDphysda RUNTIME DESTINATION bin)
\ No newline at end of file
+install(TARGETS ITSSDDBASda
+                ITSSDDGAINda
+                ITSSDDINJda
+                ITSSPDFOda
+                ITSSPDPHYSda
+                ITSSPDSCANda
+                ITSSPDVertexDiamondda
+                ITSSSDPEDda
+                            RUNTIME DESTINATION bin)
index 34992e0..f51a696 100644 (file)
@@ -29,7 +29,6 @@ include_directories(${ROOT_INCLUDE_DIRS}
                     ${AliRoot_SOURCE_DIR}/STEER/ESD
                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase
                     ${AliRoot_SOURCE_DIR}/STEER/STEER
-                    ${AliRoot_SOURCE_DIR}/TPC
                    )
 
 # Sources in alphabetical order
@@ -146,6 +145,8 @@ set(SRCS
    )
 if (DATE_FOUND)
     set (SRCS ${SRCS} "AliITSHandleDaSSD.cxx")
+    # set the definitions per folder to be passed to ROOT
+    add_definitions(-DALI_DATE)
 endif (DATE_FOUND)
 
 # Headers from sources
index f3a7821..0ba4e31 100644 (file)
@@ -94,19 +94,24 @@ get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
 set(ROOT_DEPENDECIES Core EG Geom Gpad Graf Hist MathCore Matrix Net RIO Tree)
-set(ALIROOT_DEPENDECIES CDB ESD STEERBase STEER ITSbase ITSsim RAWDatabase RAWDatarec)
+set(ALIROOT_DEPENDENCIES CDB ESD STEERBase STEER ITSbase ITSsim RAWDatabase RAWDatarec)
 
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ALIROOT_DEPENDECIES})
+set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDECIES})
 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} ${ALIROOT_DEPENDENCIES} ${ALIROOT_DEPENDENCIES})
+# 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:ITSrec-object>)
+
+# Linking library
+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)
@@ -118,4 +123,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:ITSrec-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 f1e57f1..2ae0550 100644 (file)
@@ -76,7 +76,7 @@ get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
 set(ROOT_DEPENDENCIES Core EG Geom Gpad Graf Hist MathCore Matrix Physics RIO Tree VMC)
-set(ALIROOT_DEPENDENCIES CDB ESD STEERBase STEER ITSbase ITSrec RAWDatabase RAWDatarec)
+set(ALIROOT_DEPENDENCIES CDB ESD STEERBase STEER ITSbase RAWDatabase RAWDatarec)
 
 # Generate the ROOT map
 # Dependecies
@@ -84,12 +84,17 @@ set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_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:ITSsim-object>)
+
+# 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)
@@ -101,4 +106,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:ITSsim-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)