Fixes for object target dependencies
[u/mrichter/AliRoot.git] / HLT / trigger / 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 AliHLTTrigger)
18
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/HLT/trigger)
21
22 # Additional include folders in alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIRS}
24                     ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSISalice
25                     ${AliRoot_SOURCE_DIR}/HLT/BASE
26                     ${AliRoot_SOURCE_DIR}/HLT/BASE/util
27                     ${AliRoot_SOURCE_DIR}/HLT/ITS
28                     ${AliRoot_SOURCE_DIR}/HLT/MUON
29                     ${AliRoot_SOURCE_DIR}/HLT/TRD
30                     ${AliRoot_SOURCE_DIR}/MUON/MUONraw
31                     ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
32                     ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
33                     ${AliRoot_SOURCE_DIR}/STEER/AOD
34                     ${AliRoot_SOURCE_DIR}/STEER/CDB
35                     ${AliRoot_SOURCE_DIR}/STEER/ESD
36                     ${AliRoot_SOURCE_DIR}/STEER/STEER
37                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase
38                     ${AliRoot_SOURCE_DIR}/TPC/TPCcalib
39                     ${AliRoot_SOURCE_DIR}/TRD/TRDbase
40                     ${AliRoot_SOURCE_DIR}/TRD/TRDrec
41                    )
42
43 # Sources in alphabetical order
44 set(SRCS
45     AliHLTD0Candidate.cxx
46     AliHLTD0toKpi.cxx
47     AliHLTD0Trigger.cxx
48     AliHLTEmcalElectronMonitorComponent.cxx
49     AliHLTEmcalElectronMonitor.cxx
50     AliHLTFastJetMonitorComponent.cxx
51     AliHLTFastJetMonitor.cxx
52     AliHLTGlobalTriggerComponent.cxx
53     AliHLTGlobalTriggerConfig.cxx
54     AliHLTGlobalTrigger.cxx
55     AliHLTGlobalTriggerWrapper.cxx
56     AliHLTMuonSpectroScalars.cxx
57     AliHLTMuonSpectroTriggerComponent.cxx
58     AliHLTTRDTriggerComponent.cxx
59     AliHLTTriggerAgent.cxx
60     AliHLTTriggerBarrelGeomMultiplicity.cxx
61     AliHLTTriggerBarrelMultiplicity.cxx
62     AliHLTTriggerCaloClusterEnergy.cxx
63     AliHLTTriggerCaloClusterEnergy.cxx
64     AliHLTTriggerCosmics.cxx
65     AliHLTTriggerCounterComponent.cxx
66     AliHLTTriggerCounters.cxx
67     AliHLTTriggerDecisionParameters.cxx
68     AliHLTTriggerDetectorGeom.cxx
69     AliHLTTriggerDetectorGeomRectangle.cxx
70     AliHLTTriggerEmcalClusterEnergy.cxx
71     AliHLTTriggerEmcalElectron.cxx
72     AliHLTTriggerGammaConversion.cxx
73     AliHLTTrigger.cxx
74     AliHLTTriggerITSMultiplicity.cxx
75     AliHLTTriggerPhosClusterEnergy.cxx
76     AliHLTTriggerPhosMip.cxx
77     AliHLTTriggerTrdClusterMultiplicity.cxx
78     AliHLTUpcTriggerComponent.cxx
79    )
80
81 if(FASTJET_FOUND)
82     include_directories(${FASTJET_INCLUDE_DIR})
83     link_directories(${FASTJET_LIBS_DIR})
84     add_definitions(${FASTJET_DEFINITIONS})
85
86     set(SRC ${SRCS}
87         AliHLTTriggerFastJet.h
88        )
89 endif()
90
91 # Headers from sources
92 string(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
96 get_directory_property(incdirs INCLUDE_DIRECTORIES)
97 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
98
99 # Generate the ROOT map
100 # Dependecies
101 set(LIBDEPS STEERBase STEER ESD CDB AOD RAWDatabase RAWDatarec ANALYSISalice HLTbase AliHLTUtil AliHLTITS AliHLTMUON AliHLTTRD TRDbase TRDrec TPCcalib MUONraw GenVector Gpad Graf Smatrix)
102 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
103
104 # Add a library to the project using the specified source files
105 add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
106 target_link_libraries(${MODULE} STEERBase STEER ESD CDB AOD RAWDatabase RAWDatarec ANALYSISalice HLTbase AliHLTUtil AliHLTITS AliHLTMUON AliHLTTRD TRDbase TRDrec TPCcalib MUONraw GenVector Gpad Graf Smatrix)
107 if(FASTJET_FOUND)
108     target_link_libraries(${MODULE} ${FASTJET_LIBS})
109 endif(FASTJET_FOUND)
110
111 # Additional compilation flags
112 set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "")
113
114 # System dependent: Modify the way the library is build
115 if(${CMAKE_SYSTEM} MATCHES Darwin)
116     set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
117 endif(${CMAKE_SYSTEM} MATCHES Darwin)
118
119 # Installation
120 install(TARGETS ${MODULE}
121         ARCHIVE DESTINATION lib
122         LIBRARY DESTINATION lib)
123
124 install(FILES ${HDRS} DESTINATION include)