Intermediary DA files. We need to fix first the circular dependecies in order to...
authoragrigora <alina.grigoras@cern.ch>
Fri, 21 Nov 2014 10:39:29 +0000 (11:39 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:51:59 +0000 (13:51 +0100)
ITS/DA/CMakeLists.txt [new file with mode: 0644]
ITS/DA/ITSSDDBASda.cxx [moved from ITS/ITSSDDBASda.cxx with 100% similarity]
ITS/DA/ITSSDDGAINda.cxx [moved from ITS/ITSSDDGAINda.cxx with 100% similarity]
ITS/DA/ITSSDDINJda.cxx [moved from ITS/ITSSDDINJda.cxx with 100% similarity]
ITS/DA/ITSSPDFOda.cxx [moved from ITS/ITSSPDFOda.cxx with 100% similarity]
ITS/DA/ITSSPDPHYSda.cxx [moved from ITS/ITSSPDPHYSda.cxx with 100% similarity]
ITS/DA/ITSSPDSCANda.cxx [moved from ITS/ITSSPDSCANda.cxx with 100% similarity]
ITS/DA/ITSSPDVertexDiamondda.cxx [moved from ITS/ITSSPDVertexDiamondda.cxx with 100% similarity]
ITS/DA/ITSSSDPEDda.cxx [moved from ITS/ITSSSDPEDda.cxx with 100% similarity]
ITS/ITSbase/CMakeLists.txt

diff --git a/ITS/DA/CMakeLists.txt b/ITS/DA/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c89898d
--- /dev/null
@@ -0,0 +1,68 @@
+# **************************************************************************
+# * 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}/HMPID/DA)
+
+# Additional include folders in alphabetical order
+include_directories(
+                   )
+
+
+# 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(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)
+
+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)
+
+# 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}")
+
+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
similarity index 100%
rename from ITS/ITSSDDBASda.cxx
rename to ITS/DA/ITSSDDBASda.cxx
similarity index 100%
rename from ITS/ITSSDDGAINda.cxx
rename to ITS/DA/ITSSDDGAINda.cxx
similarity index 100%
rename from ITS/ITSSDDINJda.cxx
rename to ITS/DA/ITSSDDINJda.cxx
similarity index 100%
rename from ITS/ITSSPDFOda.cxx
rename to ITS/DA/ITSSPDFOda.cxx
similarity index 100%
rename from ITS/ITSSPDPHYSda.cxx
rename to ITS/DA/ITSSPDPHYSda.cxx
similarity index 100%
rename from ITS/ITSSPDSCANda.cxx
rename to ITS/DA/ITSSPDSCANda.cxx
similarity index 100%
rename from ITS/ITSSSDPEDda.cxx
rename to ITS/DA/ITSSSDPEDda.cxx
index e2347e0..0078ff0 100644 (file)
@@ -119,17 +119,24 @@ string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
+# Setting the dependencies
+set(ROOT_DEPENDENCIES GenVector Gui)
+set(ALIROOT_DEPENDENCIES CDB ESD STEERBase STEER ITSrec ITSsim RAWDatabase RAWDatarec RAWDatasim)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS CDB ESD STEERBase STEER ITSrec ITSsim RAWDatabase RAWDatarec RAWDatasim GenVector Gui)
+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:ITSbase-object>)
+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)
@@ -141,4 +148,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:ITSbase-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)