]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/ITSrec/CMakeLists.txt
Fixes for object target dependencies
[u/mrichter/AliRoot.git] / ITS / ITSrec / CMakeLists.txt
CommitLineData
56966a5e 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 ITSrec)
18
19# Module include folder
427d561c 20include_directories(${AliRoot_SOURCE_DIR}/ITS/${MODULE})
56966a5e 21
22# Additional include folders in alphabetical order except ROOT
23include_directories(${ROOT_INCLUDE_DIRS}
427d561c 24 ${AliRoot_SOURCE_DIR}/ITS/ITSbase
25 ${AliRoot_SOURCE_DIR}/ITS/ITSsim
26 ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
27 ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
28 ${AliRoot_SOURCE_DIR}/STEER/CDB
29 ${AliRoot_SOURCE_DIR}/STEER/ESD
30 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
31 ${AliRoot_SOURCE_DIR}/STEER/STEER
56966a5e 32 )
33
34# Sources in alphabetical order
35set(SRCS
36 AliITSAlignMille2Constraint.cxx
37 AliITSAlignMille2ConstrArray.cxx
38 AliITSAlignMille2.cxx
39 AliITSAlignMille2Module.cxx
40 AliITSAlignMille.cxx
41 AliITSAlignMilleData.cxx
42 AliITSAlignMilleModule.cxx
43 AliITSBadChannelsAuxSPD.cxx
44 AliITSBadChannelsSPD.cxx
45 AliITSChannelSPD.cxx
46 AliITSclustererV2.cxx
56966a5e 47 AliITSCorrectSDDPoints.cxx
48 AliITSdEdxAnalyzer.cxx
56966a5e 49 AliITSIOTrack.cxx
50 AliITSMeanVertexer.cxx
56966a5e 51 AliITSOnlineCalibrationSPD.cxx
52 AliITSOnlineCalibrationSPDhandler.cxx
53 AliITSOnlineSDDBase.cxx
54 AliITSOnlineSDDCMN.cxx
55 AliITSOnlineSDD.cxx
56 AliITSOnlineSDDInjectors.cxx
57 AliITSOnlineSDDTP.cxx
58 AliITSOnlineSPDfoAnalyzer.cxx
59 AliITSOnlineSPDfoChipConfig.cxx
60 AliITSOnlineSPDfoChip.cxx
61 AliITSOnlineSPDfo.cxx
62 AliITSOnlineSPDfoInfo.cxx
63 AliITSOnlineSPDHitArray.cxx
64 AliITSOnlineSPDHitEvent.cxx
65 AliITSOnlineSPDphysAnalyzer.cxx
66 AliITSOnlineSPDphys.cxx
67 AliITSOnlineSPDphysInfo.cxx
68 AliITSOnlineSPDscanAnalyzer.cxx
69 AliITSOnlineSPDscan.cxx
70 AliITSOnlineSPDscanInfo.cxx
71 AliITSOnlineSPDscanInfoMeanTh.cxx
72 AliITSOnlineSPDscanInfoMultiple.cxx
73 AliITSOnlineSPDscanMeanTh.cxx
74 AliITSOnlineSPDscanMultiple.cxx
75 AliITSOnlineSPDscanSingle.cxx
76 AliITSPreprocessorSDD.cxx
77 AliITSPreprocessorSPD.cxx
78 AliITSPreprocessorSSD.cxx
56966a5e 79 AliITSQASSDRefData.cxx
80 AliITSRad.cxx
81 AliITSRealignTracks.cxx
82 AliITSreconstruction.cxx
56966a5e 83 AliITSSumTP.cxx
84 AliITSTPArrayFit.cxx
56966a5e 85 AliITSVertexer3DTapan.cxx
56966a5e 86 )
87
88# Headers from sources
89string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
90
91# Generate the dictionary
92# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
93get_directory_property(incdirs INCLUDE_DIRECTORIES)
94generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
95
efc69e78 96set(ROOT_DEPENDECIES Core EG Geom Gpad Graf Hist MathCore Matrix Net RIO Tree)
90dcc14b 97set(ALIROOT_DEPENDENCIES CDB ESD STEERBase STEER ITSbase ITSsim RAWDatabase RAWDatarec)
efc69e78 98
56966a5e 99# Generate the ROOT map
100# Dependecies
90dcc14b 101set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDECIES})
56966a5e 102generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
103
90dcc14b 104# Create an object to be reused in case of static libraries
105# Otherwise the sources will be compiled twice
106add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
107# Add a library to the project using the object
68aeb13b 108add_library(${MODULE} SHARED $<TARGET_OBJECTS:${MODULE}-object>)
109
110# Setting the correct headers for the object as gathered from the dependencies
111target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
112set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
90dcc14b 113
114# Linking library
115target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
56966a5e 116
117# Additional compilation flags
68aeb13b 118set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS " ")
56966a5e 119
120# System dependent: Modify the way the library is build
121if(${CMAKE_SYSTEM} MATCHES Darwin)
122 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
123endif(${CMAKE_SYSTEM} MATCHES Darwin)
124
125# Installation
126install(TARGETS ${MODULE}
127 ARCHIVE DESTINATION lib
128 LIBRARY DESTINATION lib)
129
90dcc14b 130install(FILES ${HDRS} DESTINATION include)
131
132# Static version if DA enabled
133if(ALIROOT_STATIC)
68aeb13b 134 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:${MODULE}-object>)
90dcc14b 135 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
136
137 # list of shared dependencies / the name of the variable containing the list of static ones
138 generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
139 target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root)
68aeb13b 140
141 # Public include folders that will be propagated to the dependecies
142 target_include_directories(${MODULE}-static PUBLIC ${incdirs})
143
90dcc14b 144 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
145
146 # Installation
147 install(TARGETS ${MODULE}-static
148 ARCHIVE DESTINATION lib
149 LIBRARY DESTINATION lib)
150endif(ALIROOT_STATIC)