Split: fixed incpaths for ANALYSISalice -> OADB
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / 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 PWGJEEMCALJetTasks)
18
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/PWGJE/EMCALJetTasks
21                     ${AliRoot_SOURCE_DIR}/PWGJE/EMCALJetTasks/UserTasks
22                    )
23
24 # Additional include folders in alphabetical order except ROOT
25 include_directories(${ROOT_INCLUDE_DIRS}
26                     ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSIS
27                     ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSISalice
28                     ${AliRoot_SOURCE_DIR}/EMCAL/EMCALbase
29                     ${AliRoot_SOURCE_DIR}/EMCAL/EMCALUtils
30                     ${AliRoot_SOURCE_DIR}/OADB
31                     ${AliRoot_SOURCE_DIR}/PWG/EMCAL
32                     ${AliRoot_SOURCE_DIR}/PWG/Tools
33                     ${AliRoot_SOURCE_DIR}/PYTHIA6/pythia6
34                     ${AliRoot_SOURCE_DIR}/STEER/AOD
35                     ${AliRoot_SOURCE_DIR}/STEER/ESD
36                     ${AliRoot_SOURCE_DIR}/STEER/STEER
37                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase
38                    )
39
40 # Sources in alphabetical order
41 set(SRCS
42     AliAnalysisTaskDeltaPt.cxx
43     AliAnalysisTaskEmcalJet.cxx
44     AliAnalysisTaskEmcalJetSample.cxx
45     AliAnalysisTaskLocalRho.cxx
46     AliAnalysisTaskRhoAverage.cxx
47     AliAnalysisTaskRhoBase.cxx
48     AliAnalysisTaskRho.cxx
49     AliAnalysisTaskRhoFlow.cxx
50     AliAnalysisTaskRhoMassBase.cxx
51     AliAnalysisTaskRhoMass.cxx
52     AliAnalysisTaskRhoSparse.cxx
53     AliAnalysisTaskScale.cxx
54     AliEmcalJetByJetCorrection.cxx
55     AliEmcalJet.cxx
56     AliEmcalPicoTrackInGridMaker.cxx
57     AliJetConstituentTagCopier.cxx
58     AliJetContainer.cxx
59     AliJetEmbeddingFromGenTask.cxx
60     AliJetEmbeddingFromPYTHIATask.cxx
61     AliJetEmbeddingTask.cxx
62     AliJetFastSimulation.cxx
63     AliJetModelBaseTask.cxx
64     AliJetModelCopyTracks.cxx
65     AliJetModelMergeBranches.cxx
66     AliJetRandomizerTask.cxx
67     AliJetResponseMaker.cxx
68     AliJetTriggerSelectionTask.cxx
69     AliLocalRhoParameter.cxx
70     AliPythiaInfo.cxx
71     AliRhoParameter.cxx
72     Tracks/AliAnalysisTaskPtEMCalTrigger.cxx
73     Tracks/AliAnalysisTaskPtEMCalTriggerV1.cxx
74     Tracks/AliCutValueRange.cxx
75     Tracks/AliEMCalHistoContainer.cxx
76     Tracks/AliEMCalPtTaskTrackSelectionAOD.cxx
77     Tracks/AliEMCalPtTaskTrackSelectionESD.cxx
78     Tracks/AliEMCalPtTaskVTrackSelection.cxx
79     Tracks/AliEMCalTriggerAnaTriggerDecision.cxx
80     Tracks/AliEMCalTriggerBinningComponent.cxx
81     Tracks/AliEMCalTriggerBinningFactory.cxx
82     Tracks/AliEMCalTriggerClusterAnalysisComponent.cxx
83     Tracks/AliEMCalTriggerEventCounterAnalysisComponent.cxx
84     Tracks/AliEMCalTriggerEventData.cxx
85     Tracks/AliEMCalTriggerEventSelection.cxx
86     Tracks/AliEMCalTriggerKineCuts.cxx
87     Tracks/AliEMCalTriggerMCJetAnalysisComponent.cxx
88     Tracks/AliEMCalTriggerMCParticleAnalysisComponent.cxx
89     Tracks/AliEMCalTriggerPatchAnalysisComponent.cxx
90     Tracks/AliEMCalTriggerRecJetAnalysisComponent.cxx
91     Tracks/AliEMCalTriggerRecTrackAnalysisComponent.cxx
92     Tracks/AliEMCalTriggerTaskGroup.cxx
93     Tracks/AliEMCalTriggerTracksAnalysisComponent.cxx
94     UserTasks/AliAnalysisTaskChargedJetsPA.cxx
95     UserTasks/AliAnalysisTaskCLQA.cxx
96     UserTasks/AliAnalysisTaskDcalDijetPerf.cxx
97     UserTasks/AliAnalysisTaskDeltaPtJEmb.cxx
98     UserTasks/AliAnalysisTaskDijetHadron.cxx
99     UserTasks/AliAnalysisTaskEmcalBadCells.cxx
100     UserTasks/AliAnalysisTaskEmcalDiJetAna.cxx
101     UserTasks/AliAnalysisTaskEmcalDiJetBase.cxx
102     UserTasks/AliAnalysisTaskEmcalDiJetResponse.cxx
103     UserTasks/AliAnalysisTaskEmcalHighMultTrigger.cxx
104     UserTasks/AliAnalysisTaskEmcalHJetMass.cxx
105     UserTasks/AliAnalysisTaskEmcalJetHadCorQA.cxx
106     UserTasks/AliAnalysisTaskEmcalJetHadEPpid.cxx
107     UserTasks/AliAnalysisTaskEmcalJetHMEC.cxx
108     UserTasks/AliAnalysisTaskEmcalJetMassBkg.cxx
109     UserTasks/AliAnalysisTaskEmcalJetMass.cxx
110     UserTasks/AliAnalysisTaskEmcalJetMassResponse.cxx
111     UserTasks/AliAnalysisTaskEmcalJetMassStructure.cxx
112     UserTasks/AliAnalysisTaskEmcalJetPatchTriggerQA.cxx
113     UserTasks/AliAnalysisTaskEmcalJetSpectra.cxx
114     UserTasks/AliAnalysisTaskEmcalJetSpectraMECpA.cxx
115     UserTasks/AliAnalysisTaskEmcalJetTagger.cxx
116     UserTasks/AliAnalysisTaskEmcalJetTriggerQA.cxx
117     UserTasks/AliAnalysisTaskEmcalJetv2QA.cxx
118     UserTasks/AliAnalysisTaskEmcalQGTagging.cxx
119     UserTasks/AliAnalysisTaskEmcalTriggerInfoQA.cxx
120     UserTasks/AliAnalysisTaskEmcalTriggerTreeWriter.cxx
121     UserTasks/AliAnalysisTaskHJetEmbed.cxx
122     UserTasks/AliAnalysisTaskJetJTJT.cxx
123     UserTasks/AliAnalysisTaskJetMassResponseDet.cxx
124     UserTasks/AliAnalysisTaskJetMatching.cxx
125     UserTasks/AliAnalysisTaskJetShapeConst.cxx
126     UserTasks/AliAnalysisTaskJetShapeDeriv.cxx
127     UserTasks/AliAnalysisTaskJetShapeGR.cxx
128     UserTasks/AliAnalysisTaskJetV2.cxx
129     UserTasks/AliAnalysisTaskRhoMassScale.cxx
130     UserTasks/AliAnalysisTaskSAJF.cxx
131     UserTasks/AliAnalysisTaskSAQA.cxx
132     UserTasks/AliAnalysisTaskSOH.cxx
133     UserTasks/AliAnalysisTaskTriggerRejection.cxx
134     UserTasks/AliAnalysisTaskV0sInJetsEmcal.cxx
135     UserTasks/AliEmcalPicoTrackFromJetMaker.cxx
136    )
137
138 if(FASTJET_FOUND)
139     set(SRCS ${SRCS}
140         AliFJWrapper.cxx
141         AliEmcalJetUtility.cxx
142         AliEmcalJetUtilityGenSubtractor.cxx
143         AliEmcalJetUtilityConstSubtractor.cxx
144         AliEmcalJetTask.cxx
145         AliEmcalJetFinder.cxx
146         AliJetEmbeddingFromAODTask.cxx
147         UserTasks/AliAnalysisTaskFullpAJets.cxx
148         UserTasks/AliAnalysisTaskFullppJet.cxx
149         UserTasks/AliAnalysisTaskHJetDphi.cxx
150         UserTasks/AliAnalysisTaskHJetSpectra.cxx
151        )
152
153     include_directories(#${AliRoot_SOURCE_DIR}/HLT/FJWrapper
154                         ${AliRoot_SOURCE_DIR}/JETAN/JETAN
155                        )
156     include_directories(SYSTEM ${FASTJET_INCLUDE_DIR})
157     link_directories(${FASTJET_LIBS_DIR})
158     add_definitions(${FASTJET_DEFINITIONS})
159 endif(FASTJET_FOUND)
160
161
162 # Headers from sources
163 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
164
165 if(FASTJET_FOUND)
166   set(HDRS ${HDRS}
167       FJ_includes.h
168      )
169 endif(FASTJET_FOUND)
170
171 # Generate the dictionary
172 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
173 get_directory_property(incdirs INCLUDE_DIRECTORIES)
174 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
175
176 set(ROOT_DEPENDENCIES)
177 set(ALIROOT_DEPENDENCIES ANALYSIS)
178 if(FASTJET_FOUND)
179     set(ALIROOT_DEPENDENCIES JETAN ${ALIROOT_DEPENDENCIES})
180 endif(FASTJET_FOUND)
181
182 # Generate the ROOT map
183 # Dependecies
184 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
185 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
186
187 # Create an object to be reused in case of static libraries 
188 # Otherwise the sources will be compiled twice
189 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
190 # Add a library to the project using the object
191 add_library(${MODULE} SHARED $<TARGET_OBJECTS:${MODULE}-object>)
192 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
193
194 # Setting the correct headers for the object as gathered from the dependencies
195 target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
196 set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
197
198 # Public include folders that will be propagated to the dependecies
199 target_include_directories(${MODULE} PUBLIC ${incdirs})
200
201 set(MODULE_COMPILE_FLAGS)
202 set(MODULE_LINK_FLAGS)
203
204 if(DATE_FOUND)
205     set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS}")
206     set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${DATE_LIBS}")
207 endif(DATE_FOUND)
208
209 # Additional compilation and linking flags
210 set(MODULE_COMPILE_FLAGS " ${MODULE_COMPILE_FLAGS}")
211
212 # System dependent: Modify the way the library is build
213 if(${CMAKE_SYSTEM} MATCHES Darwin)
214     set(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}")
215 endif(${CMAKE_SYSTEM} MATCHES Darwin)
216
217 # Setting compilation flags for the object
218 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
219 # Setting the linking flags for the library
220 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
221
222 # Installation
223 install(TARGETS ${MODULE}
224         ARCHIVE DESTINATION lib
225         LIBRARY DESTINATION lib)
226
227 install(FILES ${HDRS} DESTINATION include)
228
229 # Installing the macros
230 install (DIRECTORY macros DESTINATION PWGJE/EMCALJetTasks)