1 # **************************************************************************
2 # * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4 # * Author: The ALICE Off-line Project. *
5 # * Contributors are mentioned in the code where appropriate. *
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 # **************************************************************************
16 # HLTbase + subfolders (end of the cmake file)
17 # Subfolders have to be includes at the begining otherwise
18 # they will inherit properties from the parent
19 add_subdirectory(HOMER)
20 add_subdirectory(interface)
21 add_subdirectory(util)
26 # Module include folder
27 include_directories(${ROOT_INCLUDE_DIR}
28 ${AliRoot_SOURCE_DIR}/HLT/BASE
31 # Additional include folders in alphabetical order except ROOT
33 ${AliRoot_SOURCE_DIR}/HLT/BASE/HOMER
34 ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
35 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
38 option(USE_DLOPEN "Use \"dlopen()\" in favor of \"gSystem->Load()\" to load HLT component libraries." OFF)
41 add_definitions(-DHAVE_DLFCN_H)
42 message(STATUS "Using dlopen() for HLT component libs.")
45 option(HLT_COMPONENT_STATISTICS "Build HLT component statistics" OFF)
47 if(HLT_COMPONENT_STATISTICS)
48 add_definitions(-DHLT_COMPONENT_STATISTICS)
49 message(STATUS "HLT component statistics enabled.")
50 endif(HLT_COMPONENT_STATISTICS)
52 # Sources in alphabetical order
54 AliHLTBlockDataCollection.cxx
55 AliHLTCalibrationProcessor.cxx
56 AliHLT_C_Component_WrapperInterface.cxx
57 AliHLT_C_Component_WrapperInterface.cxx
58 AliHLTComponentBenchmark.cxx
59 AliHLTComponentConfiguration.cxx
61 AliHLTComponentHandler.cxx
62 AliHLTConfiguration.cxx
63 AliHLTConfigurationHandler.cxx
64 AliHLTConsumerDescriptor.cxx
69 AliHLTDataDeflater.cxx
70 AliHLTDataDeflaterHuffman.cxx
71 AliHLTDataDeflaterSimple.cxx
72 AliHLTDataInflater.cxx
73 AliHLTDataInflaterHuffman.cxx
74 AliHLTDataInflaterSimple.cxx
84 AliHLTEventStatistics.cxx
85 AliHLTGlobalTriggerDecision.cxx
86 AliHLTHOMERBlockDesc.cxx
87 AliHLTHOMERLibManager.cxx
88 AliHLTHOMERManager.cxx
89 AliHLTHOMERProxyHandler.cxx
90 AliHLTHOMERSourceDesc.cxx
97 AliHLTModulePreprocessor.cxx
98 AliHLTOfflineDataSource.cxx
99 AliHLTOfflineInterface.cxx
100 AliHLTOnlineConfiguration.cxx
102 AliHLTOUTComponent.cxx
103 AliHLTOUTHandlerChain.cxx
104 AliHLTOUTHandlerDetectorDDL.cxx
105 AliHLTOUTHandlerEquId.cxx
106 AliHLTOUTHandlerEsdBranch.cxx
108 AliHLTOUTHandlerIgnore.cxx
109 AliHLTOUTHomerBuffer.cxx
113 AliHLTReadoutList.cxx
114 AliHLTReconstructorBase.cxx
115 AliHLTRunStatistics.cxx
117 AliHLTShuttleInterface.cxx
118 AliHLTSpacePointContainer.cxx
121 AliHLTTrackGeometry.cxx
122 AliHLTTriggerDecision.cxx
123 AliHLTTriggerDomain.cxx
124 AliHLTTriggerMenu.cxx
125 AliHLTTriggerMenuItem.cxx
126 AliHLTTriggerMenuSymbol.cxx
127 AliHLTTTreeProcessor.cxx
130 # Headers from sources
131 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
133 AliHLTCommonCDBEntries.h
135 AliHLTExternalTrackParam.h
136 AliHLTLoggingVariadicFree.h
140 # Generate the dictionary
141 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
142 get_directory_property(incdirs INCLUDE_DIRECTORIES)
143 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
145 set(ROOT_DEPENDENCIES Core Geom Graf Hist MathCore Net RIO Tree XMLParser)
146 set(ALIROOT_DEPENDENCIES STEERBase RAWDatabase AliHLTHOMER)
147 # Generate the ROOT map
149 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
150 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
152 # Create an object to be reused in case of static libraries
153 # Otherwise the sources will be compiled twice
154 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
155 # Follow headers dependencies
156 add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES})
157 # Add a library to the project using the object
158 add_library(${MODULE} SHARED $<TARGET_OBJECTS:HLTbase-object>)
159 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
161 # Additional compilation flags
162 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS " ")
164 # System dependent: Modify the way the library is build
165 if(${CMAKE_SYSTEM} MATCHES Darwin)
166 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
167 endif(${CMAKE_SYSTEM} MATCHES Darwin)
170 install(TARGETS ${MODULE}
171 ARCHIVE DESTINATION lib
172 LIBRARY DESTINATION lib)
174 install(FILES ${HDRS} AliHLTIndexGrid.h DESTINATION include)
176 # Static version if DA enabled
178 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:HLTbase-object>)
179 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
180 target_link_libraries(${MODULE}-static STEERBase-static RAWDatabase-static AliHLTHOMER-static Root RootExtra)
181 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
184 install(TARGETS ${MODULE}-static
185 ARCHIVE DESTINATION lib
186 LIBRARY DESTINATION lib)
187 endif(ALIROOT_STATIC)