]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/EMCALbase/CMakeLists.txt
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / EMCAL / EMCALbase / CMakeLists.txt
CommitLineData
2509791b 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
16# Module
17set(MODULE EMCALbase)
18
19# Module include folder
427d561c 20include_directories(${AliRoot_SOURCE_DIR}/EMCAL/${MODULE})
2509791b 21
22# Additional include folders in alphabetical order except ROOT
23include_directories(${ROOT_INCLUDE_DIRS}
427d561c 24 ${AliRoot_SOURCE_DIR}/EMCAL/EMCALraw
427d561c 25 ${AliRoot_SOURCE_DIR}/EMCAL/EMCALUtils
26 ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
27 ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
df9719ef 28 ${AliRoot_SOURCE_DIR}/RAW/RAWDatasim
427d561c 29 ${AliRoot_SOURCE_DIR}/STEER/CDB
30 ${AliRoot_SOURCE_DIR}/STEER/ESD
31 ${AliRoot_SOURCE_DIR}/STEER/STEER
32 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
2509791b 33 )
34
35# Sources in alphabetical order
36set(SRCS
37 AliCaloCalibPedestal.cxx
38 AliCaloCalibSignal.cxx
39 AliEMCALBiasAPD.cxx
40 AliEMCALCalibAbs.cxx
41 AliEMCALCalibData.cxx
42 AliEMCALCalibMapAPD.cxx
43 AliEMCALCalibReference.cxx
44 AliEMCALCalibTempCoeff.cxx
45 AliEMCALCalibTimeDep.cxx
46 AliEMCAL.cxx
47 AliEMCALDigit.cxx
48 AliEMCALDigitizer.cxx
49 AliEMCALHit.cxx
50 AliEMCALLoader.cxx
51 AliEMCALPreprocessor.cxx
52 AliEMCALQAChecker.cxx
53 AliEMCALRawDigit.cxx
df9719ef 54 AliEMCALRawUtils.cxx
2509791b 55 AliEMCALRecParam.cxx
56 AliEMCALRecPoint.cxx
57 AliEMCALSDigitizer.cxx
58 AliEMCALSensorTempArray.cxx
59 AliEMCALSensorTemp.cxx
60 AliEMCALSimParam.cxx
61 AliEMCALSpaceFrame.cxx
62 AliEMCALSurvey.cxx
2509791b 63 AliEMCALTriggerData.cxx
64 AliEMCALTriggerDCSConfig.cxx
65 AliEMCALTriggerDCSConfigDB.cxx
66 AliEMCALTriggerRawDigit.cxx
67 AliEMCALTriggerRawDigitMaker.cxx
68 AliEMCALTriggerSTUDCSConfig.cxx
69 AliEMCALTriggerSTURawStream.cxx
70 AliEMCALTriggerTRUDCSConfig.cxx
71 AliEMCALWsuCosmicRaySetUp.cxx
72 )
73
74# Headers from sources
75string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
76
77# Generate the dictionary
78# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
79get_directory_property(incdirs INCLUDE_DIRECTORIES)
80generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
81
139cbc46 82set(ROOT_DEPENDENCIES)
68aeb13b 83set(ALIROOT_DEPENDENCIES STEERBase STEER CDB ESD RAWDatabase RAWDatarec RAWDatasim EMCALraw EMCALUtils)
139cbc46 84
2509791b 85# Generate the ROOT map
86# Dependecies
139cbc46 87set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
2509791b 88generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
89
f82bfa66 90# Create an object to be reused in case of static libraries
91# Otherwise the sources will be compiled twice
139cbc46 92add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
93# Build dependencies for object, headers, defines etc
94add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES})
f82bfa66 95# Add a library to the project using the object
68aeb13b 96add_library(${MODULE} SHARED $<TARGET_OBJECTS:${MODULE}-object>)
2509791b 97
f82bfa66 98# dependencies
139cbc46 99target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
2509791b 100
68aeb13b 101# Setting the correct headers for the object as gathered from the dependencies
102target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
103set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
104
2509791b 105# Additional compilation flags
139cbc46 106set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "")
2509791b 107
108# System dependent: Modify the way the library is build
109if(${CMAKE_SYSTEM} MATCHES Darwin)
110 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
111endif(${CMAKE_SYSTEM} MATCHES Darwin)
112
113# Installation
114install(TARGETS ${MODULE}
115 ARCHIVE DESTINATION lib
116 LIBRARY DESTINATION lib)
117
f82bfa66 118install(FILES ${HDRS} DESTINATION include)
119
120# Static version if DA enabled
121if(ALIROOT_STATIC)
68aeb13b 122 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:${MODULE}-object>)
f82bfa66 123 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
68aeb13b 124
125 # list of shared dependencies / the name of the variable containing the list of static ones
126 generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
127 target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root RootExtra)
128
129 # Public include folders that will be propagated to the dependecies
130 target_include_directories(${MODULE}-static PUBLIC ${incdirs})
131
f82bfa66 132 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
133
134 # Installation
135 install(TARGETS ${MODULE}-static
136 ARCHIVE DESTINATION lib
137 LIBRARY DESTINATION lib)
138endif(ALIROOT_STATIC)