]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/CMakeLists.txt
Update master to aliroot
[u/mrichter/AliRoot.git] / HLT / BASE / CMakeLists.txt
CommitLineData
8bb711ff 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
728a6467 16# HLTbase + subfolders (end of the cmake file)
f82bfa66 17# Subfolders have to be includes at the begining otherwise
b5a0ad8b 18# they will inherit properties from the parent
19add_subdirectory(HOMER)
7af7e653 20add_subdirectory(interface)
b5a0ad8b 21add_subdirectory(util)
728a6467 22
8bb711ff 23# Module
24set(MODULE HLTbase)
25
26# Module include folder
f0315837 27include_directories(${ROOT_INCLUDE_DIR}
28 ${AliRoot_SOURCE_DIR}/HLT/BASE
8bb711ff 29 )
30
31# Additional include folders in alphabetical order except ROOT
27d54f3d 32include_directories(
7a78a624 33 ${AliRoot_SOURCE_DIR}/HLT/BASE/HOMER
b5a0ad8b 34 ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
27d54f3d 35 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
8bb711ff 36 )
37
0552c2fe 38option(USE_DLOPEN "Use \"dlopen()\" in favor of \"gSystem->Load()\" to load HLT component libraries." OFF)
39
40if(USE_DLOPEN)
41 add_definitions(-DHAVE_DLFCN_H)
42 message(STATUS "Using dlopen() for HLT component libs.")
43endif(USE_DLOPEN)
44
d2c58191 45option(HLT_COMPONENT_STATISTICS "Build HLT component statistics" OFF)
46
47if(HLT_COMPONENT_STATISTICS)
48 add_definitions(-DHLT_COMPONENT_STATISTICS)
49 message(STATUS "HLT component statistics enabled.")
50endif(HLT_COMPONENT_STATISTICS)
51
8bb711ff 52# Sources in alphabetical order
53set(SRCS
54 AliHLTBlockDataCollection.cxx
55 AliHLTCalibrationProcessor.cxx
56 AliHLT_C_Component_WrapperInterface.cxx
57 AliHLT_C_Component_WrapperInterface.cxx
58 AliHLTComponentBenchmark.cxx
59 AliHLTComponentConfiguration.cxx
60 AliHLTComponent.cxx
61 AliHLTComponentHandler.cxx
62 AliHLTConfiguration.cxx
63 AliHLTConfigurationHandler.cxx
64 AliHLTConsumerDescriptor.cxx
65 AliHLTControlTask.cxx
66 AliHLTCTPData.cxx
67 AliHLTDAQ.cxx
68 AliHLTDataBuffer.cxx
69 AliHLTDataDeflater.cxx
70 AliHLTDataDeflaterHuffman.cxx
71 AliHLTDataDeflaterSimple.cxx
72 AliHLTDataInflater.cxx
73 AliHLTDataInflaterHuffman.cxx
74 AliHLTDataInflaterSimple.cxx
75 AliHLTDataSink.cxx
76 AliHLTDataSource.cxx
77 AliHLTDataTypes.cxx
78 AliHLTDataTypes.cxx
79 AliHLTDimServer.cxx
80 AliHLTDomainEntry.cxx
81 AliHLTDumpTask.cxx
82 AliHLTErrorGuard.cxx
83 AliHLTEsdManager.cxx
84 AliHLTEventStatistics.cxx
85 AliHLTGlobalTriggerDecision.cxx
86 AliHLTHOMERBlockDesc.cxx
87 AliHLTHOMERLibManager.cxx
88 AliHLTHOMERManager.cxx
89 AliHLTHOMERProxyHandler.cxx
90 AliHLTHOMERSourceDesc.cxx
91 AliHLTHuffman.cxx
92 AliHLTLogging.cxx
93 AliHLTMemoryFile.cxx
94 AliHLTMessage.cxx
95 AliHLTMisc.cxx
96 AliHLTModuleAgent.cxx
97 AliHLTModulePreprocessor.cxx
98 AliHLTOfflineDataSource.cxx
99 AliHLTOfflineInterface.cxx
100 AliHLTOnlineConfiguration.cxx
101 AliHLTOUT.cxx
27d54f3d 102 AliHLTOUTComponent.cxx
8bb711ff 103 AliHLTOUTHandlerChain.cxx
104 AliHLTOUTHandlerDetectorDDL.cxx
105 AliHLTOUTHandlerEquId.cxx
106 AliHLTOUTHandlerEsdBranch.cxx
107 AliHLTOUTHandler.cxx
108 AliHLTOUTHandlerIgnore.cxx
109 AliHLTOUTHomerBuffer.cxx
110 AliHLTOUTTask.cxx
111 AliHLTPluginBase.cxx
112 AliHLTProcessor.cxx
113 AliHLTReadoutList.cxx
114 AliHLTReconstructorBase.cxx
115 AliHLTRunStatistics.cxx
116 AliHLTScalars.cxx
117 AliHLTShuttleInterface.cxx
118 AliHLTSpacePointContainer.cxx
8bb711ff 119 AliHLTSystem.cxx
120 AliHLTTask.cxx
121 AliHLTTrackGeometry.cxx
122 AliHLTTriggerDecision.cxx
123 AliHLTTriggerDomain.cxx
124 AliHLTTriggerMenu.cxx
125 AliHLTTriggerMenuItem.cxx
126 AliHLTTriggerMenuSymbol.cxx
127 AliHLTTTreeProcessor.cxx
128 )
129
130# Headers from sources
131string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
132set(HDRS ${HDRS}
133 AliHLTCommonCDBEntries.h
134 AliHLTDefinitions.h
135 AliHLTExternalTrackParam.h
136 AliHLTLoggingVariadicFree.h
137 AliHLTStdIncludes.h
138 )
139
140# Generate the dictionary
141# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
142get_directory_property(incdirs INCLUDE_DIRECTORIES)
143generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
144
7a78a624 145set(ROOT_DEPENDENCIES Core Geom Graf Hist MathCore Net RIO Tree XMLParser)
146set(ALIROOT_DEPENDENCIES STEERBase RAWDatabase AliHLTHOMER)
8bb711ff 147# Generate the ROOT map
148# Dependecies
7a78a624 149set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
8bb711ff 150generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
151
f82bfa66 152# Create an object to be reused in case of static libraries
153# Otherwise the sources will be compiled twice
7a78a624 154add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
139cbc46 155# Follow headers dependencies
156add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES})
f82bfa66 157# Add a library to the project using the object
7a78a624 158add_library(${MODULE} SHARED $<TARGET_OBJECTS:HLTbase-object>)
159target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
8bb711ff 160
161# Additional compilation flags
68aeb13b 162set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS " ")
8bb711ff 163
164# System dependent: Modify the way the library is build
165if(${CMAKE_SYSTEM} MATCHES Darwin)
166 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
167endif(${CMAKE_SYSTEM} MATCHES Darwin)
168
169# Installation
170install(TARGETS ${MODULE}
171 ARCHIVE DESTINATION lib
172 LIBRARY DESTINATION lib)
173
3a76c635 174install(FILES ${HDRS} AliHLTIndexGrid.h DESTINATION include)
f82bfa66 175
176# Static version if DA enabled
177if(ALIROOT_STATIC)
178 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:HLTbase-object>)
179 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
139cbc46 180 target_link_libraries(${MODULE}-static STEERBase-static RAWDatabase-static AliHLTHOMER-static Root RootExtra)
f82bfa66 181 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
182
183 # Installation
184 install(TARGETS ${MODULE}-static
185 ARCHIVE DESTINATION lib
186 LIBRARY DESTINATION lib)
187endif(ALIROOT_STATIC)