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