]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/CMakeLists.txt
PWGLFforward2 is converted to native cmake- The custom targets and functions are...
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / 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 PWGLFforward2)
18
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/PWGLF/FORWARD)
21
22 # Additional includes - alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIRS}
24                     ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSIS
25                     ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSISalice
26                     ${AliRoot_SOURCE_DIR}/OADB
27                     ${AliRoot_SOURCE_DIR}/PWGLF/FORWARD/analysis2
28                     ${AliRoot_SOURCE_DIR}/STEER/AOD
29                     ${AliRoot_SOURCE_DIR}/STEER/ESD
30                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase
31   )
32
33 # Sources - alphabetical order
34 set(SRCS
35   # ZDC tasks
36   GEO/AliAnalysisTaskZDCPbPb.cxx
37   GEO/AliAnalysisTaskZDCTreeMaker.cxx
38   GEO/AliAnalysisTaskZDCpAcalib.cxx
39   # AOD objects
40   analysis2/AliAODCentralMult.cxx
41   analysis2/AliAODForwardEP.cxx
42   analysis2/AliAODForwardMult.cxx
43   # Interface to OADB backed by a TTree 
44   analysis2/AliOADBForward.cxx
45   # Correction managers 
46   analysis2/AliCorrectionManagerBase.cxx 
47   analysis2/AliForwardCorrectionManager.cxx
48   analysis2/AliCentralCorrectionManager.cxx
49   # Central (SPD) code 
50   analysis2/AliCentralCorrAcceptance.cxx 
51   analysis2/AliCentralCorrSecondaryMap.cxx
52   analysis2/AliCentraldNdetaTask.cxx
53   analysis2/AliCentralMCCorrectionsTask.cxx
54   analysis2/AliCentralMCMultiplicityTask.cxx
55   analysis2/AliCentralMultiplicityTask.cxx
56   analysis2/AliSPDMCTrackDensity.cxx
57   # Aux tasks and code 
58   analysis2/AliCopyHeaderTask.cxx
59   analysis2/AliBasedNdetaTask.cxx
60   analysis2/AliBaseMCTrackDensity.cxx
61   analysis2/AliMCTruthdNdetaTask.cxx
62   analysis2/AliDisplacedVertexSelection.cxx
63   analysis2/AliPoissonCalculator.cxx
64   analysis2/AliMCAuxHandler.cxx
65   # Forward Aux
66   analysis2/AliForwardFlowWeights.cxx
67   analysis2/AliForwardUtil.cxx
68   analysis2/AliFMDMultCuts.cxx
69   # FMD corrections
70   analysis2/AliFMDCorrAcceptance.cxx
71   analysis2/AliFMDCorrDoubleHit.cxx
72   analysis2/AliFMDCorrector.cxx 
73   analysis2/AliFMDCorrELossFit.cxx 
74   analysis2/AliFMDCorrMergingEfficiency.cxx
75   analysis2/AliFMDCorrSecondaryMap.cxx 
76   analysis2/AliFMDCorrVertexBias.cxx
77   # FMD algortithmns 
78   analysis2/AliFMDDensityCalculator.cxx
79   analysis2/AliFMDEnergyFitter.cxx
80   analysis2/AliFMDEventInspector.cxx
81   analysis2/AliFMDEventPlaneFinder.cxx
82   analysis2/AliFMDHistCollector.cxx
83   analysis2/AliFMDESDFixer.cxx
84   analysis2/AliFMDSharingFilter.cxx
85   # FMD MC algorithms
86   analysis2/AliFMDMCCorrector.cxx
87   analysis2/AliFMDMCDensityCalculator.cxx
88   analysis2/AliFMDMCEventInspector.cxx
89   analysis2/AliFMDMCSharingFilter.cxx
90   analysis2/AliFMDMCTrackDensity.cxx
91   # Forward tasks 
92   analysis2/AliBaseESDTask.cxx
93   analysis2/AliBaseAODTask.cxx
94   analysis2/AliBaseMCCorrectionsTask.cxx
95   analysis2/AliFMDEnergyFitterTask.cxx 
96   analysis2/AliFMDEventPlaneTask.cxx
97   analysis2/AliForwarddNdetaTask.cxx
98   analysis2/AliForwardFlowTaskQC.cxx
99   analysis2/AliForwardMCCorrectionsTask.cxx
100   analysis2/AliForwardMCFlowTaskQC.cxx
101   analysis2/AliForwardMCMultiplicityTask.cxx 
102   analysis2/AliForwardMultiplicityBase.cxx
103   analysis2/AliForwardMultiplicityTask.cxx
104   analysis2/AliForwardQATask.cxx
105   analysis2/AliForwardCreateResponseMatrices.cxx
106   analysis2/AliForwardMultiplicityDistribution.cxx
107   analysis2/AliForwardMultDists.cxx
108   # MC investigations 
109   analysis2/AliFMDMCTrackELoss.cxx
110   analysis2/AliFMDMCTrackInspector.cxx 
111   analysis2/AliFMDMCTrackInspectorTask.cxx 
112   # Photons 
113   photons/AliAnalysisTaskPMD.cxx
114   photons/AliAnalysisTaskPMDSim.cxx
115   )
116
117 # Headers from sources
118 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
119
120 # Additional headers
121 set ( HDRS ${HDRS} 
122   analysis2/AliFMDStripIndex.h 
123   analysis2/AliFMDEncodedEdx.h 
124   analysis2/AliLandauGaus.h 
125   analysis2/AliLandauGausFitter.h 
126   analysis2/AliFMDCorrNoiseGain.h
127   )
128
129 # Additional definitions
130 if((DEFINED ALIROOT_SVN_REVISION)) 
131   add_definitions(-DALIROOT_SVN_REVISION=${ALIROOT_SVN_REVISION})
132 elseif((DEFINED ALIROOT_REVISION)) 
133   add_definitions(-DALIROOT_REVISION=\"${ALIROOT_REVISION}\")
134 endif((DEFINED ALIROOT_SVN_REVISION)) 
135 if((DEFINED ALIROOT_SVN_BRANCH)) 
136   add_definitions(-DALIROOT_SVN_BRANCH=\"${ALIROOT_SVN_BRANCH}\")
137 elseif((DEFINED ALIROOT_BRANCH)) 
138   add_definitions(-DALIROOT_BRANCH=\"${ALIROOT_BRANCH}\")
139 endif((DEFINED ALIROOT_SVN_BRANCH))
140
141 # Generate the dictionary
142 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
143 get_directory_property(incdirs INCLUDE_DIRECTORIES)
144 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
145
146 # Add a shared library
147 add_library(${MODULE} SHARED  ${SRCS} G__${MODULE}.cxx)
148
149 # Generate the ROOT map
150 # Dependecies
151 set(LIBDEPS ANALYSISalice)
152 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
153
154 # Linking the library
155 target_link_libraries(${MODULE} ${LIBDEPS})
156
157 # Public include folders that will be propagated to the dependecies
158 target_include_directories(${MODULE} PUBLIC ${incdirs})
159
160 # System dependent: Modify the way the library is build
161 if(${CMAKE_SYSTEM} MATCHES Darwin)
162     set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
163 endif(${CMAKE_SYSTEM} MATCHES Darwin)
164
165 # Installation
166 install(TARGETS ${MODULE} 
167   ARCHIVE DESTINATION lib
168   LIBRARY DESTINATION lib)
169 install(FILES ${HDRS} DESTINATION include)
170
171 # Extra executable
172 add_executable(runTrain
173   trains/trainMain.cxx
174   )
175 target_link_libraries(runTrain ANALYSISalice Rint)
176 install(TARGETS runTrain 
177   RUNTIME DESTINATION bin)
178
179 # --------------------------------------------------------------------
180 # Extra targets 
181 #
182 add_custom_command( OUTPUT doc/alice-int-2012-040.pdf 
183                     COMMAND pdflatex alice-int-2012-040
184                     COMMAND pdflatex alice-int-2012-040
185                     COMMAND pdflatex alice-int-2012-040
186                     COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/doc
187                     COMMAND mv alice-int-2012-040.pdf ${CMAKE_CURRENT_BINARY_DIR}/doc/
188                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc
189                     MAIN_DEPENDENCY doc/alice-int-2012-040.tex)
190
191 add_custom_command( OUTPUT doc/html/index.html 
192                     COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/doc
193                     COMMAND sed -e 's,\\.\\./,${CMAKE_CURRENT_SOURCE_DIR}/,' -e 's,OUTPUT_DIRECTORY *=.*,OUTPUT_DIRECTORY = doc/,' < ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile > ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
194                     COMMAND doxygen ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
195                     DEPENDS ${SRCS} ${HDRS})
196
197 add_custom_target( PWGLFforward-doc DEPENDS doc/alice-int-2012-040.pdf )
198 add_custom_target( PWGLFforward-doxy DEPENDS doc/html/index.html )
199
200 add_custom_target( install-PWGLFforward2.par 
201   COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${PACKAGE}.par ${CMAKE_INSTALL_PREFIX}
202   COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --green --bold "${PACKAGE}.par installed in ${CMAKE_INSTALL_PREFIX}"
203   DEPENDS ${CMAKE_BINARY_DIR}/${PACKAGE}.par
204   DEPENDS test-${PACKAGE}.par)
205
206 # --------------------------------------------------------------------
207 # Extra installation targets 
208 #
209 # Install scripts 
210 install ( DIRECTORY analysis2/scripts 
211           DESTINATION PWGLF/FORWARD/analysis2 
212           USE_SOURCE_PERMISSIONS
213           PATTERN "*~"    EXCLUDE
214           PATTERN ".svn"  EXCLUDE
215           PATTERN "*.d"   EXCLUDE 
216           PATTERN "*.so"  EXCLUDE)
217
218 # install QA scripts 
219 install ( DIRECTORY analysis2/qa
220           DESTINATION PWGLF/FORWARD/analysis2 
221           USE_SOURCE_PERMISSIONS
222           PATTERN "*~"    EXCLUDE
223           PATTERN ".svn"  EXCLUDE
224           PATTERN "*.d"   EXCLUDE 
225           PATTERN "*.so"  EXCLUDE)
226
227 # install correction scripts 
228 install ( DIRECTORY analysis2/corrs
229           DESTINATION PWGLF/FORWARD/analysis2 
230           PATTERN "*~"    EXCLUDE
231           PATTERN ".svn"  EXCLUDE
232           PATTERN "*.d"   EXCLUDE 
233           PATTERN "*.so"  EXCLUDE)
234
235 # install trains 
236 install ( DIRECTORY analysis2/trains 
237           DESTINATION PWGLF/FORWARD/analysis2 
238           PATTERN "*~"   EXCLUDE
239           PATTERN ".svn" EXCLUDE
240           PATTERN "*.d"  EXCLUDE 
241           PATTERN "*.so" EXCLUDE)
242
243 # install trains 
244 install ( DIRECTORY trains 
245           DESTINATION PWGLF/FORWARD 
246           FILES_MATCHING PATTERN "*.C"
247           PATTERN "*~"        EXCLUDE
248           PATTERN ".svn"      EXCLUDE)
249
250 # Install other scripts
251 install ( FILES analysis2/AddTaskCentraldNdeta.C
252                 analysis2/AddTaskCentralMCCorr.C
253                 analysis2/AddTaskCentralMult.C
254                 analysis2/AddTaskCentralTracks.C
255                 analysis2/AddTaskCopyHeader.C
256                 analysis2/AddTaskFMDELoss.C
257                 analysis2/AddTaskFMDEventPlane.C
258                 analysis2/AddTaskFMDMCTracks.C
259                 analysis2/AddTaskForwardFlowQC.C
260                 analysis2/AddTaskForwardMCCorr.C
261                 analysis2/AddTaskForwardMult.C
262                 analysis2/AddTaskForwardMultDists.C
263                 analysis2/AddTaskForwardQA.C
264                 analysis2/AddTaskForwarddNdeta.C
265                 analysis2/AddTaskMCTruthdNdeta.C
266                 analysis2/AddTaskMCParticleFilter.C
267                 analysis2/DrawdNdeta.C
268                 analysis2/DrawdNdetaSummary.C
269                 analysis2/DrawMCCorrSummary.C
270                 analysis2/DrawAODSummary.C
271                 analysis2/DrawMultDistsSummary.C
272                 analysis2/DrawUnfoldedSummary.C
273                 analysis2/ForwardAODConfig.C
274                 analysis2/CentralAODConfig.C
275                 analysis2/dNdetaConfig.C
276                 analysis2/MakeAOD.C
277                 analysis2/MakedNdeta.C
278                 analysis2/MakeELossFits.C
279                 analysis2/MakeEvaluateTriggers.C
280                 analysis2/MakeFlow.C
281                 analysis2/MakeFMDEventPlane.C
282                 analysis2/MakeForwardQA.C
283                 analysis2/MakeMCCorr.C          
284                 analysis2/OtherData.C
285                 analysis2/other.root
286            DESTINATION PWGLF/FORWARD/analysis2 )
287
288 # Install corrections 
289 install ( DIRECTORY corrections/Empirical
290                     corrections/Normalization
291           DESTINATION PWGLF/FORWARD/corrections 
292           PATTERN "*~"   EXCLUDE
293           PATTERN ".svn" EXCLUDE)
294
295 # Install shell script 
296 install ( FILES analysis2/Run.sh 
297                 analysis2/liteAnalysis.sh
298                 analysis2/gridAnalysis.sh
299                 analysis2/baseAnalysis.sh
300           DESTINATION PWGLF/FORWARD/analysis2 
301           PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
302                       GROUP_EXECUTE GROUP_READ
303                       WORLD_EXECUTE WORLD_READ )
304
305 # install sim 
306 install ( DIRECTORY analysis2/sim 
307          DESTINATION PWGLF/FORWARD/analysis2 
308          PATTERN "*~"   EXCLUDE
309          PATTERN ".svn" EXCLUDE
310          PATTERN "*.d"  EXCLUDE 
311          PATTERN "*.so" EXCLUDE)
312        
313
314 # --------------------------------------------------------------------