]>
Commit | Line | Data |
---|---|---|
464611d8 | 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 TRDbase) | |
18 | ||
19 | # Module include folder | |
427d561c | 20 | include_directories(${AliRoot_SOURCE_DIR}/TRD/${MODULE}) |
464611d8 | 21 | |
22 | # Additional include folders in alphabetical order except ROOT | |
23 | include_directories(${ROOT_INCLUDE_DIRS} | |
427d561c | 24 | ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase |
25 | ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec | |
26 | ${AliRoot_SOURCE_DIR}/STEER/CDB | |
27 | ${AliRoot_SOURCE_DIR}/STEER/ESD | |
28 | ${AliRoot_SOURCE_DIR}/STEER/STEER | |
29 | ${AliRoot_SOURCE_DIR}/STEER/STEERBase | |
464611d8 | 30 | ) |
31 | ||
32 | # Sources in alphabetical order | |
33 | set(SRCS | |
34 | AliTRDalignment.cxx | |
35 | AliTRDarrayADC.cxx | |
36 | AliTRDarrayDictionary.cxx | |
37 | AliTRDarraySignal.cxx | |
38 | AliTRDCalChamberStatus.cxx | |
39 | AliTRDCalDCS.cxx | |
40 | AliTRDCalDCSFEE.cxx | |
41 | AliTRDCalDCSFEEv2.cxx | |
42 | AliTRDCalDCSGTUBoardInfo.cxx | |
43 | AliTRDCalDCSGTUCtpOpc.cxx | |
44 | AliTRDCalDCSGTU.cxx | |
45 | AliTRDCalDCSGTUSegment.cxx | |
46 | AliTRDCalDCSGTUTgu.cxx | |
47 | AliTRDCalDCSGTUTmu.cxx | |
48 | AliTRDCalDCSPTR.cxx | |
49 | AliTRDCalDCSv2.cxx | |
50 | AliTRDCalDet.cxx | |
51 | AliTRDCalibChamberStatus.cxx | |
52 | AliTRDcalibDB.cxx | |
53 | AliTRDCalibPadStatus.cxx | |
54 | AliTRDCalibraExbAltFit.cxx | |
13269fe5 | 55 | AliTRDCalibraFillHisto.cxx |
464611d8 | 56 | AliTRDCalibraFit.cxx |
57 | AliTRDCalibraMode.cxx | |
58 | AliTRDCalibraVdriftLinearFit.cxx | |
59 | AliTRDCalibraVector.cxx | |
60 | AliTRDCalibViewer.cxx | |
61 | AliTRDCalibViewerGUI.cxx | |
62 | AliTRDCalMonitoring.cxx | |
63 | AliTRDCalOnlineGainTable.cxx | |
64 | AliTRDCalOnlineGainTableMCM.cxx | |
65 | AliTRDCalOnlineGainTableROC.cxx | |
66 | AliTRDCalPad.cxx | |
67 | AliTRDCalPadStatus.cxx | |
68 | AliTRDCalPID.cxx | |
69 | AliTRDCalROC.cxx | |
70 | AliTRDCalSingleChamberStatus.cxx | |
71 | AliTRDCalTrapConfig.cxx | |
72 | AliTRDCalTrkAttach.cxx | |
13269fe5 | 73 | AliTRDchamberTimeBin.cxx |
464611d8 | 74 | AliTRDCommonParam.cxx |
13269fe5 | 75 | AliTRDcluster.cxx |
76 | AliTRDclusterizer.cxx | |
464611d8 | 77 | AliTRDDataDCS.cxx |
13269fe5 | 78 | AliTRDdEdxBaseUtils.cxx |
79 | AliTRDdEdxCalibHistArray.cxx | |
80 | AliTRDdEdxCalibUtils.cxx | |
81 | AliTRDdEdxReconUtils.cxx | |
464611d8 | 82 | AliTRDdigit.cxx |
83 | AliTRDdigitsManager.cxx | |
84 | AliTRDdigitsParam.cxx | |
85 | AliTRDEntriesInfo.cxx | |
86 | AliTRDfeeParam.cxx | |
87 | AliTRDgeometry.cxx | |
88 | AliTRDgtuParam.cxx | |
89 | AliTRDgtuSim.cxx | |
90 | AliTRDgtuTMU.cxx | |
91 | AliTRDhit.cxx | |
92 | AliTRDltuParam.cxx | |
93 | AliTRDmcmSim.cxx | |
94 | AliTRDonlineTrackMatching.cxx | |
95 | AliTRDpadPlane.cxx | |
96 | AliTRDPhInfo.cxx | |
13269fe5 | 97 | AliTRDpidUtil.cxx |
464611d8 | 98 | AliTRDPreprocessor.cxx |
99 | AliTRDPrfInfo.cxx | |
100 | AliTRDQAChecker.cxx | |
101 | AliTRDrawData.cxx | |
102 | AliTRDrawStream.cxx | |
103 | AliTRDrecoParam.cxx | |
13269fe5 | 104 | AliTRDReconstructor.cxx |
464611d8 | 105 | AliTRDSaxHandler.cxx |
13269fe5 | 106 | AliTRDseedV1.cxx |
464611d8 | 107 | AliTRDSensorArray.cxx |
108 | AliTRDSensor.cxx | |
109 | AliTRDSignalIndex.cxx | |
110 | AliTRDSimParam.cxx | |
111 | AliTRDtrackGTU.cxx | |
13269fe5 | 112 | AliTRDtrackerDebug.cxx |
113 | AliTRDtrackerV1.cxx | |
114 | AliTRDtrackingChamber.cxx | |
115 | AliTRDtrackingSector.cxx | |
464611d8 | 116 | AliTRDtrackletBase.cxx |
117 | AliTRDtrackletGTU.cxx | |
13269fe5 | 118 | AliTRDtrackletOflHelper.cxx |
464611d8 | 119 | AliTRDtrackletMCM.cxx |
120 | AliTRDtrackletWord.cxx | |
121 | AliTRDtrackOnline.cxx | |
13269fe5 | 122 | AliTRDtrackV1.cxx |
123 | AliTRDtransform.cxx | |
464611d8 | 124 | AliTRDtrapConfig.cxx |
125 | AliTRDtrapConfigHandler.cxx | |
126 | AliTRDUshortInfo.cxx | |
127 | ) | |
128 | ||
129 | # Headers from sources | |
130 | string(REPLACE ".cxx" ".h" HDRS "${SRCS}") | |
131 | ||
cae58aab | 132 | # Setting compile and link flags in case of date |
133 | if(DATE_FOUND) | |
134 | set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS}") | |
135 | set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${DATE_LIBS} ${DATE_DYNMONLIBS}") | |
136 | endif(DATE_FOUND) | |
137 | ||
464611d8 | 138 | # Generate the dictionary |
139 | # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument | |
140 | get_directory_property(incdirs INCLUDE_DIRECTORIES) | |
141 | generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}") | |
142 | ||
13269fe5 | 143 | set(ROOT_DEPENDENCIES Core GenVector Geom Gpad Graf Gui Hist MathCore Matrix Minuit Net RIO Tree VMC XMLParser) |
144 | set(ALIROOT_DEPENDENCIES STEERBase STEER ESD CDB RAWDatabase RAWDatarec) | |
145 | ||
464611d8 | 146 | # Generate the ROOT map |
147 | # Dependecies | |
13269fe5 | 148 | set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES}) |
464611d8 | 149 | generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h") |
150 | ||
13269fe5 | 151 | # Create an object to be reused in case of static libraries |
152 | # Otherwise the sources will be compiled twice | |
153 | add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx) | |
139cbc46 | 154 | # Follow headers dependencies |
155 | add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES}) | |
13269fe5 | 156 | # Add a library to the project using the object |
157 | add_library(${MODULE} SHARED $<TARGET_OBJECTS:TRDbase-object>) | |
158 | ||
159 | # Linking | |
160 | target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES}) | |
464611d8 | 161 | |
13269fe5 | 162 | # Public include folders that will be propagated to the dependecies |
163 | target_include_directories(${MODULE} PUBLIC ${incdirs}) | |
464611d8 | 164 | |
464611d8 | 165 | # System dependent: Modify the way the library is build |
166 | if(${CMAKE_SYSTEM} MATCHES Darwin) | |
cae58aab | 167 | set_target_properties(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}") |
464611d8 | 168 | endif(${CMAKE_SYSTEM} MATCHES Darwin) |
169 | ||
170 | # Check if CRS support was enabled | |
171 | if(TRD_RAW_CRC) | |
172 | message(STATUS "CRC support for AliTRDrawStream enabled") | |
173 | add_definitions(-DTRD_RAW_CRC) | |
174 | endif(TRD_RAW_CRC) | |
175 | ||
176 | # Check if RAW debug enabled | |
177 | if(TRD_RAW_DEBUG) | |
178 | message(STATUS "Debug support for AliTRDrawStream enabled") | |
179 | add_definitions(-DTRD_RAW_DEBUG) | |
180 | endif(TRD_RAW_DEBUG) | |
181 | ||
cae58aab | 182 | # Setting the correct headers for the object as gathered from the dependencies |
183 | # Additional compilation flags | |
184 | set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}") | |
185 | set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}") | |
186 | ||
187 | # Setting the correct headers for the object as gathered from the dependencies | |
188 | # This has to be added after all the compile definitions | |
189 | target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>) | |
190 | set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>) | |
464611d8 | 191 | |
192 | # Installation | |
193 | install(TARGETS ${MODULE} | |
194 | ARCHIVE DESTINATION lib | |
195 | LIBRARY DESTINATION lib) | |
196 | ||
13269fe5 | 197 | install(FILES ${HDRS} DESTINATION include) |
198 | ||
199 | # Static version if DA enabled | |
200 | if(ALIROOT_STATIC) | |
201 | add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:TRDbase-object>) | |
202 | set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE}) | |
203 | ||
204 | # list of shared dependencies / the name of the variable containing the list of static ones | |
205 | generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES") | |
206 | target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root RootExtra) | |
207 | ||
208 | # Public include folders that will be propagated to the dependecies | |
209 | target_include_directories(${MODULE}-static PUBLIC ${incdirs}) | |
210 | ||
211 | set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive") | |
212 | ||
213 | # Installation | |
214 | install(TARGETS ${MODULE}-static | |
215 | ARCHIVE DESTINATION lib | |
216 | LIBRARY DESTINATION lib) | |
217 | endif(ALIROOT_STATIC) |