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_DIRS})
25 # Sources - alphabetical order
31 AliCollisionGeometry.cxx
32 AliCounterCollection.cxx
34 AliDetectorEventHeader.cxx
36 AliDetectorTagCuts.cxx
39 AliEMCALPIDResponse.cxx
43 AliExternalTrackParam.cxx
45 AliGenCocktailEventHeader.cxx
46 AliGenDPMjetEventHeader.cxx
47 AliGenEposEventHeader.cxx
49 AliGenEventHeaderTunedPbPb.cxx
50 AliGenGeVSimEventHeader.cxx
51 AliGenHepMCEventHeader.cxx
52 AliGenHerwigEventHeader.cxx
53 AliGenHijingEventHeader.cxx
54 AliGenPythiaEventHeader.cxx
57 AliHMPIDPIDResponse.cxx
58 AliInputEventHandler.cxx
71 AliMergeableCollection.cxx
73 AliNeutralTrackParam.cxx
99 AliTRDPIDReference.cxx
100 AliTRDPIDResponse.cxx
101 AliTRDPIDResponseObject.cxx
102 AliTRDTKDInterpolator.cxx
103 AliTriggerScalers.cxx
104 AliTriggerScalersRecord.cxx
132 # Headers from sources
133 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
135 # Generate the dictionary
136 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
137 get_directory_property(incdirs INCLUDE_DIRECTORIES)
138 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
140 # Create an object to be reused in case of static libraries
141 # Otherwise the sources will be compiled twice
142 add_library(STEERBase-object OBJECT ${SRCS} G__${MODULE}.cxx)
143 # Add a library to the project using the object
144 add_library(STEERBase SHARED $<TARGET_OBJECTS:STEERBase-object>)
146 # Generate the ROOT map
148 set(LIBDEPS Core EG Geom Gpad Graf3d Graf Hist MathCore Matrix Minuit Net Physics RIO Tree VMC)
149 generate_rootmap("STEERBase" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
151 # Additional compilation flags for the object
152 set_target_properties(STEERBase-object PROPERTIES COMPILE_FLAGS "-fPIC -O -g")
153 # Linking the library, not the object
154 target_link_libraries(STEERBase Core EG Geom Gpad Graf3d Graf Hist MathCore Matrix Minuit Net Physics RIO Tree VMC)
156 # System dependent: Modify the way the library is build
157 if(${CMAKE_SYSTEM} MATCHES Darwin)
158 set_target_properties(STEERBase PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
159 endif(${CMAKE_SYSTEM} MATCHES Darwin)
162 install(TARGETS ${MODULE}
163 ARCHIVE DESTINATION lib
164 LIBRARY DESTINATION lib)
165 install(FILES ${HDRS} DESTINATION include)
167 # Static version if DA enabled
169 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:STEERBase-object>)
170 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
171 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
172 target_link_libraries(${MODULE}-static Root)
175 install(TARGETS ${MODULE}-static
176 ARCHIVE DESTINATION lib
177 LIBRARY DESTINATION lib)
178 endif(ALIROOT_STATIC)