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 # **************************************************************************/
17 set (MODULE STEERBase)
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/STEER/${MODULE})
22 # Additional includes - alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIR}
24 ${AliRoot_BINARY_DIR}/version
27 # Sources - alphabetical order
33 AliCollisionGeometry.cxx
34 AliCounterCollection.cxx
36 AliDetectorEventHeader.cxx
38 AliDetectorTagCuts.cxx
41 AliEMCALPIDResponse.cxx
45 AliExternalTrackParam.cxx
47 AliGenCocktailEventHeader.cxx
48 AliGenDPMjetEventHeader.cxx
49 AliGenEposEventHeader.cxx
51 AliGenEventHeaderTunedPbPb.cxx
52 AliGenGeVSimEventHeader.cxx
53 AliGenHepMCEventHeader.cxx
54 AliGenHerwigEventHeader.cxx
55 AliGenHijingEventHeader.cxx
56 AliGenPythiaEventHeader.cxx
59 AliHMPIDPIDResponse.cxx
60 AliInputEventHandler.cxx
73 AliMergeableCollection.cxx
75 AliNeutralTrackParam.cxx
101 AliTRDPIDReference.cxx
102 AliTRDPIDResponse.cxx
103 AliTRDPIDResponseObject.cxx
104 AliTRDTKDInterpolator.cxx
105 AliTriggerScalers.cxx
106 AliTriggerScalersRecord.cxx
137 # Headers from sources
138 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
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 # Create an object to be reused in case of static libraries
146 # Otherwise the sources will be compiled twice
147 add_library(STEERBase-object OBJECT ${SRCS} G__${MODULE}.cxx)
148 # Add a library to the project using the object
149 add_library(STEERBase SHARED $<TARGET_OBJECTS:STEERBase-object>)
151 # Generate the ROOT map
153 set(LIBDEPS Core EG Geom Gpad Graf3d Graf Hist MathCore Matrix Minuit Net Physics RIO Tree VMC)
154 generate_rootmap("STEERBase" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
156 # Generate a PARfile target for this library
157 add_target_parfile(${MODULE} "${SRCS}" "${HDRS}" "${MODULE}LinkDef.h" "${LIBDEPS}")
159 # Additional compilation flags for the object
160 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "")
161 # Linking the library, not the object
162 target_link_libraries(${MODULE} ${LIBDEPS})
164 # Public include folders that will be propagated to the dependecies
165 target_include_directories(${MODULE} PUBLIC ${incdirs})
167 # System dependent: Modify the way the library is build
168 if(${CMAKE_SYSTEM} MATCHES Darwin)
169 set_target_properties(STEERBase PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
170 endif(${CMAKE_SYSTEM} MATCHES Darwin)
173 install(TARGETS ${MODULE}
174 ARCHIVE DESTINATION lib
175 LIBRARY DESTINATION lib)
176 install(FILES ${HDRS} DESTINATION include)
178 # Static version if DA enabled
180 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:STEERBase-object>)
181 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
182 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
183 target_link_libraries(${MODULE}-static Root RootExtra)
185 # Public include folders that will be propagated to the dependecies
186 target_include_directories(${MODULE}-static PUBLIC ${incdirs})
189 install(TARGETS ${MODULE}-static
190 ARCHIVE DESTINATION lib
191 LIBRARY DESTINATION lib)
192 endif(ALIROOT_STATIC)