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