]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/ESD/CMakeLists.txt
Geometry for run3 implemented with updated TDI
[u/mrichter/AliRoot.git] / STEER / ESD / CMakeLists.txt
1 # **************************************************************************
2 # * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
3 # *                                                                        *
4 # * Author: The ALICE Off-line Project.                                    *
5 # * Contributors are mentioned in the code where appropriate.              *
6 # *                                                                        *
7 # * Permission to use, copy, modify and distribute this software and its   *
8 # * documentation strictly for non-commercial purposes is hereby granted   *
9 # * without fee, provided that the above copyright notice appears in all   *
10 # * copies and that both the copyright notice and this permission notice   *
11 # * appear in the supporting documentation. The authors make no claims     *
12 # * about the suitability of this software for any purpose. It is          *
13 # * provided "as is" without express or implied warranty.                  *
14 # **************************************************************************
15
16 # Module
17 set(MODULE ESD)
18
19 # Module include folders
20 include_directories(${AliRoot_SOURCE_DIR}/STEER/${MODULE})
21
22 # Additional include directories - alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIRS}
24                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase)
25
26 # Sources - alphabetical order
27 set(SRCS
28     AliCascadeVertexer.cxx
29     AliESDACORDE.cxx
30     AliESDAD.cxx
31     AliESDADfriend.cxx
32     AliESDCaloCells.cxx
33     AliESDCaloCluster.cxx
34     AliESDCaloTrigger.cxx
35     AliESDcascade.cxx
36     AliESDCosmicTrack.cxx
37     AliESD.cxx
38     AliESDEvent.cxx
39     AliESDFIT.cxx
40     AliESDFMD.cxx
41     AliESDfriend.cxx
42     AliESDfriendTrack.cxx
43     AliESDHandler.cxx
44     AliESDHeader.cxx
45     AliESDHLTDecision.cxx
46     AliESDHLTtrack.cxx
47     AliESDInputHandler.cxx
48     AliESDInputHandlerRP.cxx
49     AliESDkink.cxx
50     AliESDMultITS.cxx
51     AliESDMuonCluster.cxx
52     AliESDMuonGlobalTrack.cxx
53     AliESDMuonPad.cxx
54     AliESDMuonTrack.cxx
55     AliESDpid.cxx
56     AliESDPmdTrack.cxx
57     AliESDRun.cxx
58     AliESDTOFCluster.cxx
59     AliESDTOFHit.cxx
60     AliESDTOFMatch.cxx
61     AliESDtrack.cxx
62     AliESDTrdTrack.cxx
63     AliESDTrdTracklet.cxx
64     AliESDTrdTrigger.cxx
65     AliESDTZERO.cxx
66     AliESDTZEROfriend.cxx
67     AliESDUtils.cxx
68     AliESDv0.cxx
69     AliESDV0Params.cxx
70     AliESDVertex.cxx
71     AliESDVZERO.cxx
72     AliESDVZEROfriend.cxx
73     AliESDZDC.cxx
74     AliExpression.cxx
75     AliFMDFloatMap.cxx
76     AliFMDMap.cxx
77     AliKalmanTrack.cxx
78     AliKFParticleBase.cxx
79     AliKFParticle.cxx
80     AliKFVertex.cxx
81     AliMeanVertex.cxx
82     AliMultiplicity.cxx
83     AliRawDataErrorLog.cxx
84     AliSelector.cxx
85     AliStrLine.cxx
86     AliTrackerBase.cxx
87     AliTrackPointArray.cxx
88     AliTriggerBCMask.cxx
89     AliTriggerClass.cxx
90     AliTriggerCluster.cxx
91     AliTriggerConfiguration.cxx
92     AliTriggerDescriptor.cxx
93     AliTriggerInput.cxx
94     AliTriggerInteraction.cxx
95     AliTriggerIR.cxx
96     AliTriggerPFProtection.cxx
97     AliTriggerScalersESD.cxx
98     AliTriggerScalersRecordESD.cxx
99     AliV0vertexer.cxx
100     AliVertex.cxx
101     AliVertexerTracks.cxx
102    )
103
104 # Headers from sources
105 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
106
107 # Generate the dictionary
108 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
109 get_directory_property(incdirs INCLUDE_DIRECTORIES)
110 generate_dictionary("ESD" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
111
112 set(ROOT_DEPENDENCIES Core EG Geom Gpad Graf3d MathCore Matrix Physics RIO Tree)
113 set(ALIROOT_DEPENDENCIES STEERBase)
114
115 # Generate the ROOT map
116 # Dependecies
117 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
118 generate_rootmap("ESD" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
119
120 # Generate a PARfile target for this library
121 add_target_parfile(${MODULE} "${SRCS}" "${HDRS}" "${MODULE}LinkDef.h" "${LIBDEPS}")
122
123 # Create an object to be reused in case of static libraries 
124 # Otherwise the sources will be compiled twice
125 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
126
127 # Add a library to the project using the object
128 add_library(${MODULE} SHARED $<TARGET_OBJECTS:ESD-object>)
129 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
130
131 # Setting the correct headers for the object as gathered from the dependencies
132 target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
133 set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
134
135 # Public include folders that will be propagated to the dependecies
136 target_include_directories(${MODULE} PUBLIC ${incdirs})
137
138 # Additional compilation flags for the object
139 set_target_properties(ESD-object PROPERTIES COMPILE_FLAGS "")
140
141 # System dependent: Modify the way the library is build
142 if(${CMAKE_SYSTEM} MATCHES Darwin)
143     set_target_properties(ESD PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
144 endif(${CMAKE_SYSTEM} MATCHES Darwin)
145
146 # Installation
147 install(TARGETS ${MODULE} 
148   ARCHIVE DESTINATION lib
149   LIBRARY DESTINATION lib)
150 install(FILES ${HDRS} DESTINATION include)
151
152 # Static version if DA enabled
153 if(ALIROOT_STATIC)
154     add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:ESD-object>)
155     set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
156
157     # list of shared dependencies / the name of the variable containing the list of static ones
158     generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
159
160     # Public include folders that will be propagated to the dependecies
161     target_include_directories(${MODULE}-static PUBLIC ${incdirs})
162
163     set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
164     target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root RootExtra)
165
166     # Installation
167     install(TARGETS ${MODULE}-static
168             ARCHIVE DESTINATION lib
169             LIBRARY DESTINATION lib)
170 endif(ALIROOT_STATIC)