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 # **************************************************************************
19 # Module include folders
20 include_directories(${AliRoot_SOURCE_DIR}/STEER/${MODULE})
22 # Additional include directories - alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIRS}
24 ${AliRoot_SOURCE_DIR}/STEER/STEERBase)
26 # Sources - alphabetical order
28 AliCascadeVertexer.cxx
47 AliESDInputHandler.cxx
48 AliESDInputHandlerRP.cxx
52 AliESDMuonGlobalTrack.cxx
83 AliRawDataErrorLog.cxx
87 AliTrackPointArray.cxx
91 AliTriggerConfiguration.cxx
92 AliTriggerDescriptor.cxx
94 AliTriggerInteraction.cxx
96 AliTriggerPFProtection.cxx
97 AliTriggerScalersESD.cxx
98 AliTriggerScalersRecordESD.cxx
101 AliVertexerTracks.cxx
104 # Headers from sources
105 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
107 # Generate the dictionary
108 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
109 get_directory_property(incdirs INCLUDE_DIRECTORIES)
110 generate_dictionary("ESD" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
112 set(ROOT_DEPENDENCIES Core EG Geom Gpad Graf3d MathCore Matrix Physics RIO Tree)
113 set(ALIROOT_DEPENDENCIES STEERBase)
115 # Generate the ROOT map
117 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
118 generate_rootmap("ESD" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
120 # Create an object to be reused in case of static libraries
121 # Otherwise the sources will be compiled twice
122 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
124 # Add a library to the project using the object
125 add_library(${MODULE} SHARED $<TARGET_OBJECTS:ESD-object>)
126 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
128 # Setting the correct headers for the object as gathered from the dependencies
129 target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
130 set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
132 # Public include folders that will be propagated to the dependecies
133 target_include_directories(${MODULE} PUBLIC ${incdirs})
135 # Additional compilation flags for the object
136 set_target_properties(ESD-object PROPERTIES COMPILE_FLAGS "")
138 # System dependent: Modify the way the library is build
139 if(${CMAKE_SYSTEM} MATCHES Darwin)
140 set_target_properties(ESD PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
141 endif(${CMAKE_SYSTEM} MATCHES Darwin)
144 install(TARGETS ${MODULE}
145 ARCHIVE DESTINATION lib
146 LIBRARY DESTINATION lib)
147 install(FILES ${HDRS} DESTINATION include)
149 # Static version if DA enabled
151 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:ESD-object>)
152 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
154 # list of shared dependencies / the name of the variable containing the list of static ones
155 generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
157 # Public include folders that will be propagated to the dependecies
158 target_include_directories(${MODULE}-static PUBLIC ${incdirs})
160 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
161 target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root RootExtra)
164 install(TARGETS ${MODULE}-static
165 ARCHIVE DESTINATION lib
166 LIBRARY DESTINATION lib)
167 endif(ALIROOT_STATIC)