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 folder
20 include_directories(${AliRoot_SOURCE_DIR}/PHOS/${MODULE})
22 # Additional include folders in alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIR}
24 ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
25 ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
26 ${AliRoot_SOURCE_DIR}/RAW/RAWDatasim
27 ${AliRoot_SOURCE_DIR}/PHOS/PHOSUtils
28 ${AliRoot_SOURCE_DIR}/STEER/CDB
29 ${AliRoot_SOURCE_DIR}/STEER/ESD
30 ${AliRoot_SOURCE_DIR}/STEER/STEER
31 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
34 # Sources in alphabetical order
38 AliPHOSClusterizer.cxx
39 AliPHOSClusterizerv1.cxx
40 AliPHOSCpvCalibData.cxx
41 AliPHOSCpvRecPoint.cxx
42 AliPHOSCpv3GConnection.cxx
44 AliPHOSCpvPedProducer.cxx
45 AliPHOSCpvRawDigiProducer.cxx
46 AliPHOSCpvRawStream.cxx
49 AliPHOSEmcBadChannelsMap.cxx
50 AliPHOSEmcCalibData.cxx
51 AliPHOSEmcRecPoint.cxx
52 AliPHOSFastRecParticle.cxx
58 AliPHOSModuleMisalignment.cxx
60 AliPHOSPulseGenerator.cxx
62 AliPHOSRawDigiProducer.cxx
63 AliPHOSRawFitterv0.cxx
64 AliPHOSRawFitterv1.cxx
65 AliPHOSRawFitterv2.cxx
66 AliPHOSRawFitterv3.cxx
67 AliPHOSRawFitterv4.cxx
69 AliPHOSReconstructor.cxx
70 AliPHOSRecParticle.cxx
79 AliPHOSTrackSegment.cxx
80 AliPHOSTrackSegmentMaker.cxx
81 AliPHOSTrackSegmentMakerv1.cxx
83 AliPHOSTriggerParameters.cxx
84 AliPHOSTriggerRawDigit.cxx
85 AliPHOSTriggerRawDigiProducer.cxx
86 AliPHOSTriggerRawReader.cxx
87 AliPHOSTRURawReader.cxx
91 # Headers from sources
92 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
94 # Generate the dictionary
95 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
96 get_directory_property(incdirs INCLUDE_DIRECTORIES)
97 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
99 set(ROOT_DEPENDENCIES Core EG Geom Gpad Graf Hist MathCore Matrix Minuit Physics RIO Tree VMC)
100 set(ALIROOT_DEPENDENCIES STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim PHOSUtils)
102 # Generate the ROOT map
104 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
105 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
107 # Create an object to be reused in case of static libraries
108 # Otherwise the sources will be compiled twice
109 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
110 # Follow headers dependencies
111 add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES})
112 # Add a library to the project using the object
113 add_library(${MODULE} SHARED $<TARGET_OBJECTS:PHOSbase-object>)
116 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
118 # Setting the correct headers for the object as gathered from the dependencies
119 target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
120 set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
122 # Additional compilation flags
123 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS " ")
125 # System dependent: Modify the way the library is build
126 if(${CMAKE_SYSTEM} MATCHES Darwin)
127 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
128 endif(${CMAKE_SYSTEM} MATCHES Darwin)
131 install(TARGETS ${MODULE}
132 ARCHIVE DESTINATION lib
133 LIBRARY DESTINATION lib)
135 install(FILES ${HDRS} DESTINATION include)
137 # Static version if DA enabled
139 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:PHOSbase-object>)
140 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
142 # list of shared dependencies / the name of the variable containing the list of static ones
143 generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
144 target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root)
146 # Public include folders that will be propagated to the dependecies
147 target_include_directories(${MODULE}-static PUBLIC ${incdirs})
149 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
152 install(TARGETS ${MODULE}-static
153 ARCHIVE DESTINATION lib
154 LIBRARY DESTINATION lib)
155 endif(ALIROOT_STATIC)