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