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