PHOS: CPV PED DA added
[u/mrichter/AliRoot.git] / PHOS / PHOSbase / CMakeLists.txt
CommitLineData
97e8d2a8 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 PHOSbase)
18
19# Module include folder
427d561c 20include_directories(${AliRoot_SOURCE_DIR}/PHOS/${MODULE})
97e8d2a8 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
00d82de9 26 ${AliRoot_SOURCE_DIR}/RAW/RAWDatasim
427d561c 27 ${AliRoot_SOURCE_DIR}/PHOS/PHOSUtils
28 ${AliRoot_SOURCE_DIR}/STEER/CDB
29 ${AliRoot_SOURCE_DIR}/STEER/ESD
30 ${AliRoot_SOURCE_DIR}/STEER/STEER
31 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
97e8d2a8 32 )
33
34# Sources in alphabetical order
35set(SRCS
00d82de9 36 AliPHOS.cxx
97e8d2a8 37 AliPHOSCalibData.cxx
38 AliPHOSClusterizer.cxx
00d82de9 39 AliPHOSClusterizerv1.cxx
97e8d2a8 40 AliPHOSCpvCalibData.cxx
41 AliPHOSCpvRecPoint.cxx
0d931d35 42 AliPHOSCpv3GConnection.cxx
43 AliPHOSCpvParam.cxx
0916ba78 44 AliPHOSCpvPedProducer.cxx
c68c5d05 45 AliPHOSCpvRawDigiProducer.cxx
0d931d35 46 AliPHOSCpvRawStream.cxx
97e8d2a8 47 AliPHOSDigit.cxx
48 AliPHOSDigitizer.cxx
49 AliPHOSEmcBadChannelsMap.cxx
50 AliPHOSEmcCalibData.cxx
51 AliPHOSEmcRecPoint.cxx
52 AliPHOSFastRecParticle.cxx
53 AliPHOSGeometry.cxx
54 AliPHOSHit.cxx
55 AliPHOSImpact.cxx
00d82de9 56 AliPHOSLink.cxx
97e8d2a8 57 AliPHOSLoader.cxx
58 AliPHOSModuleMisalignment.cxx
59 AliPHOSPID.cxx
60 AliPHOSPulseGenerator.cxx
61 AliPHOSQAChecker.cxx
62 AliPHOSRawDigiProducer.cxx
63 AliPHOSRawFitterv0.cxx
64 AliPHOSRawFitterv1.cxx
65 AliPHOSRawFitterv2.cxx
66 AliPHOSRawFitterv3.cxx
67 AliPHOSRawFitterv4.cxx
68 AliPHOSRecoParam.cxx
00d82de9 69 AliPHOSReconstructor.cxx
97e8d2a8 70 AliPHOSRecParticle.cxx
71 AliPHOSRecPoint.cxx
00d82de9 72 AliPHOSPIDv1.cxx
97e8d2a8 73 AliPHOSSDigitizer.cxx
74 AliPHOSSimParam.cxx
75 AliPHOSSurvey1.cxx
76 AliPHOSSurvey.cxx
00d82de9 77 AliPHOSTick.cxx
78 AliPHOSTracker.cxx
97e8d2a8 79 AliPHOSTrackSegment.cxx
80 AliPHOSTrackSegmentMaker.cxx
00d82de9 81 AliPHOSTrackSegmentMakerv1.cxx
97e8d2a8 82 AliPHOSTrigger.cxx
83 AliPHOSTriggerParameters.cxx
00d82de9 84 AliPHOSTriggerRawDigit.cxx
85 AliPHOSTriggerRawDigiProducer.cxx
86 AliPHOSTriggerRawReader.cxx
87 AliPHOSTRURawReader.cxx
88
97e8d2a8 89 )
90
91# Headers from sources
92string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
93
94# Generate the dictionary
95# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
96get_directory_property(incdirs INCLUDE_DIRECTORIES)
97generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
98
6af91854 99set(ROOT_DEPENDENCIES Core EG Geom Gpad Graf Hist MathCore Matrix Minuit Physics RIO Tree VMC)
100set(ALIROOT_DEPENDENCIES STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim PHOSUtils)
00d82de9 101
97e8d2a8 102# Generate the ROOT map
103# Dependecies
00d82de9 104set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
97e8d2a8 105generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
106
00d82de9 107# Create an object to be reused in case of static libraries
108# Otherwise the sources will be compiled twice
109add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
139cbc46 110# Follow headers dependencies
111add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES})
00d82de9 112# Add a library to the project using the object
113add_library(${MODULE} SHARED $<TARGET_OBJECTS:PHOSbase-object>)
97e8d2a8 114
00d82de9 115# Linking
6af91854 116target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
97e8d2a8 117
68aeb13b 118# Setting the correct headers for the object as gathered from the dependencies
119target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
120set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
121
97e8d2a8 122# Additional compilation flags
68aeb13b 123set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS " ")
97e8d2a8 124
125# System dependent: Modify the way the library is build
126if(${CMAKE_SYSTEM} MATCHES Darwin)
127 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
128endif(${CMAKE_SYSTEM} MATCHES Darwin)
129
130# Installation
131install(TARGETS ${MODULE}
132 ARCHIVE DESTINATION lib
133 LIBRARY DESTINATION lib)
134
00d82de9 135install(FILES ${HDRS} DESTINATION include)
136
137# Static version if DA enabled
138if(ALIROOT_STATIC)
139 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:PHOSbase-object>)
140 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
141
142 # list of shared dependencies / the name of the variable containing the list of static ones
143 generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
144 target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root)
68aeb13b 145
146 # Public include folders that will be propagated to the dependecies
147 target_include_directories(${MODULE}-static PUBLIC ${incdirs})
148
00d82de9 149 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
150
151 # Installation
152 install(TARGETS ${MODULE}-static
153 ARCHIVE DESTINATION lib
154 LIBRARY DESTINATION lib)
155endif(ALIROOT_STATIC)