]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/TRDbase/CMakeLists.txt
Correct use of ROOT_INCLUDE_DIR
[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
f0315837 23include_directories(${ROOT_INCLUDE_DIR}
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
cae58aab 132# Setting compile and link flags in case of date
133if(DATE_FOUND)
134 set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS}")
135 set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${DATE_LIBS} ${DATE_DYNMONLIBS}")
136endif(DATE_FOUND)
137
38cadb35 138# Check if CRS support was enabled
139if(TRD_RAW_CRC)
140 message(STATUS "CRC support for AliTRDrawStream enabled")
141 set(MODULE_COMPILE_FLAGS "-DTRD_RAW_CRC ${MODULE_COMPILE_FLAGS}")
142endif(TRD_RAW_CRC)
143
144# Check if RAW debug enabled
145if(TRD_RAW_DEBUG)
146 message(STATUS "Debug support for AliTRDrawStream enabled")
147 set(MODULE_COMPILE_FLAGS "-DTRD_RAW_DEBUG ${MODULE_COMPILE_FLAGS}")
148endif(TRD_RAW_DEBUG)
149
464611d8 150# Generate the dictionary
151# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
152get_directory_property(incdirs INCLUDE_DIRECTORIES)
38cadb35 153generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}" "${MODULE_COMPILE_FLAGS}")
464611d8 154
13269fe5 155set(ROOT_DEPENDENCIES Core GenVector Geom Gpad Graf Gui Hist MathCore Matrix Minuit Net RIO Tree VMC XMLParser)
156set(ALIROOT_DEPENDENCIES STEERBase STEER ESD CDB RAWDatabase RAWDatarec)
157
464611d8 158# Generate the ROOT map
159# Dependecies
13269fe5 160set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
464611d8 161generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
162
13269fe5 163# Create an object to be reused in case of static libraries
164# Otherwise the sources will be compiled twice
165add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
139cbc46 166# Follow headers dependencies
167add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES})
13269fe5 168# Add a library to the project using the object
169add_library(${MODULE} SHARED $<TARGET_OBJECTS:TRDbase-object>)
170
171# Linking
172target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
464611d8 173
13269fe5 174# Public include folders that will be propagated to the dependecies
175target_include_directories(${MODULE} PUBLIC ${incdirs})
464611d8 176
464611d8 177# System dependent: Modify the way the library is build
178if(${CMAKE_SYSTEM} MATCHES Darwin)
aa07445f 179 set(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}")
464611d8 180endif(${CMAKE_SYSTEM} MATCHES Darwin)
181
464611d8 182
cae58aab 183# Setting the correct headers for the object as gathered from the dependencies
184# Additional compilation flags
185set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
186set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
187
188# Setting the correct headers for the object as gathered from the dependencies
189# This has to be added after all the compile definitions
190target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
191set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
464611d8 192
193# Installation
194install(TARGETS ${MODULE}
195 ARCHIVE DESTINATION lib
196 LIBRARY DESTINATION lib)
197
13269fe5 198install(FILES ${HDRS} DESTINATION include)
199
200# Static version if DA enabled
201if(ALIROOT_STATIC)
202 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:TRDbase-object>)
203 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
204
205 # list of shared dependencies / the name of the variable containing the list of static ones
206 generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
207 target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root RootExtra)
208
209 # Public include folders that will be propagated to the dependecies
210 target_include_directories(${MODULE}-static PUBLIC ${incdirs})
211
212 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
213
214 # Installation
215 install(TARGETS ${MODULE}-static
216 ARCHIVE DESTINATION lib
217 LIBRARY DESTINATION lib)
218endif(ALIROOT_STATIC)