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 # Sources in alphabetical order
47 AliHLTBlockDataCollection.cxx
48 AliHLTCalibrationProcessor.cxx
49 AliHLT_C_Component_WrapperInterface.cxx
50 AliHLT_C_Component_WrapperInterface.cxx
51 AliHLTComponentBenchmark.cxx
52 AliHLTComponentConfiguration.cxx
54 AliHLTComponentHandler.cxx
55 AliHLTConfiguration.cxx
56 AliHLTConfigurationHandler.cxx
57 AliHLTConsumerDescriptor.cxx
62 AliHLTDataDeflater.cxx
63 AliHLTDataDeflaterHuffman.cxx
64 AliHLTDataDeflaterSimple.cxx
65 AliHLTDataInflater.cxx
66 AliHLTDataInflaterHuffman.cxx
67 AliHLTDataInflaterSimple.cxx
77 AliHLTEventStatistics.cxx
78 AliHLTGlobalTriggerDecision.cxx
79 AliHLTHOMERBlockDesc.cxx
80 AliHLTHOMERLibManager.cxx
81 AliHLTHOMERManager.cxx
82 AliHLTHOMERProxyHandler.cxx
83 AliHLTHOMERSourceDesc.cxx
90 AliHLTModulePreprocessor.cxx
91 AliHLTOfflineDataSource.cxx
92 AliHLTOfflineInterface.cxx
93 AliHLTOnlineConfiguration.cxx
95 AliHLTOUTComponent.cxx
96 AliHLTOUTHandlerChain.cxx
97 AliHLTOUTHandlerDetectorDDL.cxx
98 AliHLTOUTHandlerEquId.cxx
99 AliHLTOUTHandlerEsdBranch.cxx
101 AliHLTOUTHandlerIgnore.cxx
102 AliHLTOUTHomerBuffer.cxx
106 AliHLTReadoutList.cxx
107 AliHLTReconstructorBase.cxx
108 AliHLTRunStatistics.cxx
110 AliHLTShuttleInterface.cxx
111 AliHLTSpacePointContainer.cxx
114 AliHLTTrackGeometry.cxx
115 AliHLTTriggerDecision.cxx
116 AliHLTTriggerDomain.cxx
117 AliHLTTriggerMenu.cxx
118 AliHLTTriggerMenuItem.cxx
119 AliHLTTriggerMenuSymbol.cxx
120 AliHLTTTreeProcessor.cxx
123 # Headers from sources
124 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
126 AliHLTCommonCDBEntries.h
128 AliHLTExternalTrackParam.h
129 AliHLTLoggingVariadicFree.h
133 # Generate the dictionary
134 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
135 get_directory_property(incdirs INCLUDE_DIRECTORIES)
136 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
138 set(ROOT_DEPENDENCIES Core Geom Graf Hist MathCore Net RIO Tree XMLParser)
139 set(ALIROOT_DEPENDENCIES STEERBase RAWDatabase AliHLTHOMER)
140 # Generate the ROOT map
142 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
143 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
145 # Create an object to be reused in case of static libraries
146 # Otherwise the sources will be compiled twice
147 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
148 # Follow headers dependencies
149 add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES})
150 # Add a library to the project using the object
151 add_library(${MODULE} SHARED $<TARGET_OBJECTS:HLTbase-object>)
152 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
154 # Additional compilation flags
155 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS " ")
157 # System dependent: Modify the way the library is build
158 if(${CMAKE_SYSTEM} MATCHES Darwin)
159 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
160 endif(${CMAKE_SYSTEM} MATCHES Darwin)
163 install(TARGETS ${MODULE}
164 ARCHIVE DESTINATION lib
165 LIBRARY DESTINATION lib)
167 install(FILES ${HDRS} DESTINATION include)
169 # Static version if DA enabled
171 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:HLTbase-object>)
172 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
173 target_link_libraries(${MODULE}-static STEERBase-static RAWDatabase-static AliHLTHOMER-static Root RootExtra)
174 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
177 install(TARGETS ${MODULE}-static
178 ARCHIVE DESTINATION lib
179 LIBRARY DESTINATION lib)
180 endif(ALIROOT_STATIC)