]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/TRDbase/CMakeLists.txt
Coverity fix
[u/mrichter/AliRoot.git] / TRD / TRDbase / CMakeLists.txt
CommitLineData
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
17set(MODULE TRDbase)
18
19# Module include folder
427d561c 20include_directories(${AliRoot_SOURCE_DIR}/TRD/${MODULE})
464611d8 21
22# Additional include folders in alphabetical order except ROOT
23include_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
33set(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
130string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
131
132# Generate the dictionary
133# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
134get_directory_property(incdirs INCLUDE_DIRECTORIES)
135generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
136
13269fe5 137set(ROOT_DEPENDENCIES Core GenVector Geom Gpad Graf Gui Hist MathCore Matrix Minuit Net RIO Tree VMC XMLParser)
138set(ALIROOT_DEPENDENCIES STEERBase STEER ESD CDB RAWDatabase RAWDatarec)
139
464611d8 140# Generate the ROOT map
141# Dependecies
13269fe5 142set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
464611d8 143generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
144
13269fe5 145# Create an object to be reused in case of static libraries
146# Otherwise the sources will be compiled twice
147add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
139cbc46 148# Follow headers dependencies
149add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES})
13269fe5 150# Add a library to the project using the object
151add_library(${MODULE} SHARED $<TARGET_OBJECTS:TRDbase-object>)
152
153# Linking
154target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
464611d8 155
13269fe5 156# Public include folders that will be propagated to the dependecies
157target_include_directories(${MODULE} PUBLIC ${incdirs})
464611d8 158
159# Additional compilation flags
139cbc46 160set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "")
464611d8 161
162# System dependent: Modify the way the library is build
163if(${CMAKE_SYSTEM} MATCHES Darwin)
164 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
165endif(${CMAKE_SYSTEM} MATCHES Darwin)
166
167# Check if CRS support was enabled
168if(TRD_RAW_CRC)
169 message(STATUS "CRC support for AliTRDrawStream enabled")
170 add_definitions(-DTRD_RAW_CRC)
171endif(TRD_RAW_CRC)
172
173# Check if RAW debug enabled
174if(TRD_RAW_DEBUG)
175 message(STATUS "Debug support for AliTRDrawStream enabled")
176 add_definitions(-DTRD_RAW_DEBUG)
177endif(TRD_RAW_DEBUG)
178
179
180# Installation
181install(TARGETS ${MODULE}
182 ARCHIVE DESTINATION lib
183 LIBRARY DESTINATION lib)
184
13269fe5 185install(FILES ${HDRS} DESTINATION include)
186
187# Static version if DA enabled
188if(ALIROOT_STATIC)
189 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:TRDbase-object>)
190 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
191
192 # list of shared dependencies / the name of the variable containing the list of static ones
193 generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
194 target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root RootExtra)
195
196 # Public include folders that will be propagated to the dependecies
197 target_include_directories(${MODULE}-static PUBLIC ${incdirs})
198
199 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
200
201 # Installation
202 install(TARGETS ${MODULE}-static
203 ARCHIVE DESTINATION lib
204 LIBRARY DESTINATION lib)
205endif(ALIROOT_STATIC)