]>
Commit | Line | Data |
---|---|---|
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 | |
17 | set(MODULE EMCALbase) | |
18 | ||
19 | # Module include folder | |
427d561c | 20 | include_directories(${AliRoot_SOURCE_DIR}/EMCAL/${MODULE}) |
2509791b | 21 | |
22 | # Additional include folders in alphabetical order except ROOT | |
23 | include_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 | |
36 | set(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 | |
63 | AliEMCALTrigger.cxx | |
64 | AliEMCALTriggerData.cxx | |
65 | AliEMCALTriggerDCSConfig.cxx | |
66 | AliEMCALTriggerDCSConfigDB.cxx | |
67 | AliEMCALTriggerRawDigit.cxx | |
68 | AliEMCALTriggerRawDigitMaker.cxx | |
69 | AliEMCALTriggerSTUDCSConfig.cxx | |
70 | AliEMCALTriggerSTURawStream.cxx | |
71 | AliEMCALTriggerTRUDCSConfig.cxx | |
72 | AliEMCALWsuCosmicRaySetUp.cxx | |
73 | ) | |
74 | ||
75 | # Headers from sources | |
76 | string(REPLACE ".cxx" ".h" HDRS "${SRCS}") | |
77 | ||
78 | # Generate the dictionary | |
79 | # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument | |
80 | get_directory_property(incdirs INCLUDE_DIRECTORIES) | |
81 | generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}") | |
82 | ||
139cbc46 | 83 | set(ROOT_DEPENDENCIES) |
84 | set(ALIROOT_DEPENDENCIES STEERBase STEER CDB ESD RAWDatabase RAWDatarec EMCALraw EMCALUtils) | |
85 | ||
2509791b | 86 | # Generate the ROOT map |
87 | # Dependecies | |
139cbc46 | 88 | set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES}) |
2509791b | 89 | generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h") |
90 | ||
f82bfa66 | 91 | # Create an object to be reused in case of static libraries |
92 | # Otherwise the sources will be compiled twice | |
139cbc46 | 93 | add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx) |
94 | # Build dependencies for object, headers, defines etc | |
95 | add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES}) | |
f82bfa66 | 96 | # Add a library to the project using the object |
139cbc46 | 97 | add_library(${MODULE} SHARED $<TARGET_OBJECTS:EMCALbase-object>) |
2509791b | 98 | |
f82bfa66 | 99 | # dependencies |
139cbc46 | 100 | target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES}) |
2509791b | 101 | |
102 | # Additional compilation flags | |
139cbc46 | 103 | set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "") |
2509791b | 104 | |
105 | # System dependent: Modify the way the library is build | |
106 | if(${CMAKE_SYSTEM} MATCHES Darwin) | |
107 | set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") | |
108 | endif(${CMAKE_SYSTEM} MATCHES Darwin) | |
109 | ||
110 | # Installation | |
111 | install(TARGETS ${MODULE} | |
112 | ARCHIVE DESTINATION lib | |
113 | LIBRARY DESTINATION lib) | |
114 | ||
f82bfa66 | 115 | install(FILES ${HDRS} DESTINATION include) |
116 | ||
117 | # Static version if DA enabled | |
118 | if(ALIROOT_STATIC) | |
119 | add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:EMCALbase-object>) | |
120 | set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE}) | |
121 | target_link_libraries(${MODULE}-static STEERBase-static STEER-static ESD-static CDB-static AOD-static RAWDatabase-static RAWDatarec-static RAWDatasim-static EMCALraw-static EMCALUtils-static Root) | |
122 | set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive") | |
123 | ||
124 | # Installation | |
125 | install(TARGETS ${MODULE}-static | |
126 | ARCHIVE DESTINATION lib | |
127 | LIBRARY DESTINATION lib) | |
128 | endif(ALIROOT_STATIC) |