Switching from CMAKE_SOURCE_DIR to AliRoot_SOURCE_DIR
[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                     ${AliRoot_SOURCE_DIR}/TRD/TRDrec
31                    )
32
33 # Sources in alphabetical order
34 set(SRCS
35     AliTRDalignment.cxx
36     AliTRDarrayADC.cxx
37     AliTRDarrayDictionary.cxx
38     AliTRDarraySignal.cxx
39     AliTRDCalChamberStatus.cxx
40     AliTRDCalDCS.cxx
41     AliTRDCalDCSFEE.cxx
42     AliTRDCalDCSFEEv2.cxx
43     AliTRDCalDCSGTUBoardInfo.cxx
44     AliTRDCalDCSGTUCtpOpc.cxx
45     AliTRDCalDCSGTU.cxx
46     AliTRDCalDCSGTUSegment.cxx
47     AliTRDCalDCSGTUTgu.cxx
48     AliTRDCalDCSGTUTmu.cxx
49     AliTRDCalDCSPTR.cxx
50     AliTRDCalDCSv2.cxx
51     AliTRDCalDet.cxx
52     AliTRDCalibChamberStatus.cxx
53     AliTRDcalibDB.cxx
54     AliTRDCalibPadStatus.cxx
55     AliTRDCalibraExbAltFit.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     AliTRDCommonParam.cxx
74     AliTRDDataDCS.cxx
75     AliTRDdigit.cxx
76     AliTRDdigitsManager.cxx
77     AliTRDdigitsParam.cxx
78     AliTRDEntriesInfo.cxx
79     AliTRDfeeParam.cxx
80     AliTRDgeometry.cxx
81     AliTRDgtuParam.cxx
82     AliTRDgtuSim.cxx
83     AliTRDgtuTMU.cxx
84     AliTRDhit.cxx
85     AliTRDltuParam.cxx
86     AliTRDmcmSim.cxx
87     AliTRDonlineTrackMatching.cxx
88     AliTRDpadPlane.cxx
89     AliTRDPhInfo.cxx
90     AliTRDPreprocessor.cxx
91     AliTRDPrfInfo.cxx
92     AliTRDQAChecker.cxx
93     AliTRDrawData.cxx
94     AliTRDrawStream.cxx
95     AliTRDrecoParam.cxx
96     AliTRDSaxHandler.cxx
97     AliTRDSensorArray.cxx
98     AliTRDSensor.cxx
99     AliTRDSignalIndex.cxx
100     AliTRDSimParam.cxx
101     AliTRDtrackGTU.cxx
102     AliTRDtrackletBase.cxx
103     AliTRDtrackletGTU.cxx
104     AliTRDtrackletMCM.cxx
105     AliTRDtrackletWord.cxx
106     AliTRDtrackOnline.cxx
107     AliTRDtrapConfig.cxx
108     AliTRDtrapConfigHandler.cxx
109     AliTRDUshortInfo.cxx
110    )
111
112 # Headers from sources
113 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
114
115 # Generate the dictionary
116 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
117 get_directory_property(incdirs INCLUDE_DIRECTORIES)
118 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
119
120 # Generate the ROOT map
121 # Dependecies
122 set(LIBDEPS STEERBase STEER ESD CDB RAWDatabase RAWDatarec TRDrec Gpad Gui)
123 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
124
125
126 # Add a library to the project using the specified source files
127 add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
128
129 # Additional compilation flags
130 set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
131
132 # System dependent: Modify the way the library is build
133 if(${CMAKE_SYSTEM} MATCHES Darwin)
134     set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
135 endif(${CMAKE_SYSTEM} MATCHES Darwin)
136
137 # Check if CRS support was enabled
138 if(TRD_RAW_CRC)
139     message(STATUS "CRC support for AliTRDrawStream enabled")
140     add_definitions(-DTRD_RAW_CRC)
141 endif(TRD_RAW_CRC)
142
143 # Check if RAW debug enabled
144 if(TRD_RAW_DEBUG)
145     message(STATUS "Debug support for AliTRDrawStream enabled")
146     add_definitions(-DTRD_RAW_DEBUG)
147 endif(TRD_RAW_DEBUG)
148
149
150 # Installation
151 install(TARGETS ${MODULE}
152         ARCHIVE DESTINATION lib
153         LIBRARY DESTINATION lib)
154
155 install(FILES ${HDRS} DESTINATION include)