]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AOD/CMakeLists.txt
Generated static dependecies
[u/mrichter/AliRoot.git] / STEER / AOD / CMakeLists.txt
CommitLineData
e9e48ff1 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 AOD)
18
19# Module include folders
427d561c 20include_directories(${AliRoot_SOURCE_DIR}/STEER/${MODULE})
e9e48ff1 21
22# Additional include directories - alphabetical order except ROOT
22f3e2f8 23include_directories(${ROOT_INCLUDE_DIRS}
427d561c 24 ${AliRoot_SOURCE_DIR}/STEER/ESD
25 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
e9e48ff1 26 )
27
28# Sources - alphabetical order
29set(SRCS
30 AliAODBranchReplicator.cxx
31 AliAODCaloCells.cxx
32 AliAODCaloCluster.cxx
33 AliAODCaloTrigger.cxx
34 AliAODcascade.cxx
35 AliAODCluster.cxx
36 AliAODDiJet.cxx
37 AliAODDimuon.cxx
38 AliAODEvent.cxx
39 AliAODExtension.cxx
40 AliAODFmdCluster.cxx
41 AliAODHandler.cxx
42 AliAODHeader.cxx
43 AliAODHMPIDrings.cxx
44 AliAODInputHandler.cxx
45 AliAODJet.cxx
46 AliAODJetEventBackground.cxx
47 AliAODMCHeader.cxx
48 AliAODMCParticle.cxx
49 AliAODPhoton.cxx
50 AliAODPid.cxx
51 AliAODpidUtil.cxx
52 AliAODPmdCluster.cxx
53 AliAODPWG4ParticleCorrelation.cxx
54 AliAODPWG4Particle.cxx
55 AliAODRecoDecay.cxx
56 AliAODRedCov.cxx
57 AliAODTagCreator.cxx
58 AliAODTrack.cxx
59 AliAODTracklets.cxx
60 AliAODTrdTrack.cxx
61 AliAODTrdTracklet.cxx
62 AliAODTZERO.cxx
63 AliAODv0.cxx
64 AliAODVertex.cxx
65 AliAODVZERO.cxx
66 AliAODZDC.cxx
b168bfa8 67 AliNanoAODHeader.cxx
852a1808 68 AliNanoAODStorage.cxx
7296b0da 69 AliNanoAODTrackMapping.cxx
e9e48ff1 70 )
71
72# Sources from headers
73string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
74
75# Generate the dictionary
76# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
77get_directory_property(incdirs INCLUDE_DIRECTORIES)
78generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
79
852a1808 80# ROOT and other AliRoot depencies
81# Used to create the root maps and for the actual linking
82set(ROOT_DEPENDENCIES Core EG Geom Hist MathCore Matrix Net Physics RIO Tree)
83set(ALIROOT_DEPENDENCIES ESD STEERBase)
84
0224bae4 85# Generate the ROOT map
86# Dependecies
852a1808 87set(LIBDEPS ${ROOT_DEPENDENCIES} ${ALIROOT_DEPENDENCIES})
0224bae4 88generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
89
f82bfa66 90# Create an object to be reused in case of static libraries
91# Otherwise the sources will be compiled twice
92add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
93# Add a library to the project using the object
94add_library(${MODULE} SHARED $<TARGET_OBJECTS:AOD-object>)
95
96# library dependecies
852a1808 97target_link_libraries(${MODULE} ${ROOT_DEPENDENCIES} ${ALIROOT_DEPENDENCIES})
e9e48ff1 98
99# Additional compilation flags
f82bfa66 100set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-O -g -fPIC")
e9e48ff1 101
102# System dependent: Modify the way the library is build
103if(${CMAKE_SYSTEM} MATCHES Darwin)
104 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
105endif(${CMAKE_SYSTEM} MATCHES Darwin)
106
107# Installation
108install(TARGETS ${MODULE}
109 ARCHIVE DESTINATION lib
110 LIBRARY DESTINATION lib)
111install(FILES ${HDRS} DESTINATION include)
f82bfa66 112
113# Static version if DA enabled
114if(ALIROOT_STATIC)
115 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:AOD-object>)
116 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
9cfdd3fd 117
118 # list of shared dependencies / the name of the variable containing the list of static ones
119 generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
120
121 target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root RootExtra)
f82bfa66 122 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
123
124 # Installation
125 install(TARGETS ${MODULE}-static
126 ARCHIVE DESTINATION lib
127 LIBRARY DESTINATION lib)
128endif(ALIROOT_STATIC)