]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/TRDbase/CMakeLists.txt
TRD DAs
[u/mrichter/AliRoot.git] / TRD / TRDbase / 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 TRDbase)
18
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/TRD/${MODULE})
21
22 # Additional include folders in alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIRS}
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
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
55     AliTRDCalibraFillHisto.cxx
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
73     AliTRDchamberTimeBin.cxx
74     AliTRDCommonParam.cxx
75     AliTRDcluster.cxx
76     AliTRDclusterizer.cxx
77     AliTRDDataDCS.cxx
78     AliTRDdEdxBaseUtils.cxx
79     AliTRDdEdxCalibHistArray.cxx
80     AliTRDdEdxCalibUtils.cxx
81     AliTRDdEdxReconUtils.cxx
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
97     AliTRDpidUtil.cxx
98     AliTRDPreprocessor.cxx
99     AliTRDPrfInfo.cxx
100     AliTRDQAChecker.cxx
101     AliTRDrawData.cxx
102     AliTRDrawStream.cxx
103     AliTRDrecoParam.cxx
104     AliTRDReconstructor.cxx
105     AliTRDSaxHandler.cxx
106     AliTRDseedV1.cxx
107     AliTRDSensorArray.cxx
108     AliTRDSensor.cxx
109     AliTRDSignalIndex.cxx
110     AliTRDSimParam.cxx
111     AliTRDtrackGTU.cxx
112     AliTRDtrackerDebug.cxx
113     AliTRDtrackerV1.cxx
114     AliTRDtrackingChamber.cxx
115     AliTRDtrackingSector.cxx
116     AliTRDtrackletBase.cxx
117     AliTRDtrackletGTU.cxx
118     AliTRDtrackletOflHelper.cxx
119     AliTRDtrackletMCM.cxx
120     AliTRDtrackletWord.cxx
121     AliTRDtrackOnline.cxx
122     AliTRDtrackV1.cxx
123     AliTRDtransform.cxx
124     AliTRDtrapConfig.cxx
125     AliTRDtrapConfigHandler.cxx
126     AliTRDUshortInfo.cxx
127    )
128
129 # Headers from sources
130 string(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
134 get_directory_property(incdirs INCLUDE_DIRECTORIES)
135 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
136
137 set(ROOT_DEPENDENCIES Core GenVector Geom Gpad Graf Gui Hist MathCore Matrix Minuit Net RIO Tree VMC XMLParser)
138 set(ALIROOT_DEPENDENCIES STEERBase STEER ESD CDB RAWDatabase RAWDatarec)
139
140 # Generate the ROOT map
141 # Dependecies
142 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
143 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
144
145 # Create an object to be reused in case of static libraries 
146 # Otherwise the sources will be compiled twice
147 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
148 # Add a library to the project using the object
149 add_library(${MODULE} SHARED $<TARGET_OBJECTS:TRDbase-object>)
150
151 # Linking
152 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
153
154 # Public include folders that will be propagated to the dependecies
155 target_include_directories(${MODULE} PUBLIC ${incdirs})
156
157 # Additional compilation flags
158 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-O -g")
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 # Check if CRS support was enabled
166 if(TRD_RAW_CRC)
167     message(STATUS "CRC support for AliTRDrawStream enabled")
168     add_definitions(-DTRD_RAW_CRC)
169 endif(TRD_RAW_CRC)
170
171 # Check if RAW debug enabled
172 if(TRD_RAW_DEBUG)
173     message(STATUS "Debug support for AliTRDrawStream enabled")
174     add_definitions(-DTRD_RAW_DEBUG)
175 endif(TRD_RAW_DEBUG)
176
177
178 # Installation
179 install(TARGETS ${MODULE}
180         ARCHIVE DESTINATION lib
181         LIBRARY DESTINATION lib)
182
183 install(FILES ${HDRS} DESTINATION include)
184
185 # Static version if DA enabled
186 if(ALIROOT_STATIC)
187     add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:TRDbase-object>)
188     set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
189
190     # list of shared dependencies / the name of the variable containing the list of static ones
191     generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
192     target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root RootExtra)
193     
194     # Public include folders that will be propagated to the dependecies
195     target_include_directories(${MODULE}-static PUBLIC ${incdirs})
196     
197     set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
198
199     # Installation
200     install(TARGETS ${MODULE}-static
201             ARCHIVE DESTINATION lib
202             LIBRARY DESTINATION lib)
203 endif(ALIROOT_STATIC)