]>
Commit | Line | Data |
---|---|---|
464611d8 | 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 TRDsim) | |
18 | ||
19 | # Module include folder | |
427d561c | 20 | include_directories(${AliRoot_SOURCE_DIR}/TRD/${MODULE}) |
464611d8 | 21 | |
22 | # Additional include folders in alphabetical order except ROOT | |
f0315837 | 23 | include_directories(${ROOT_INCLUDE_DIR} |
427d561c | 24 | ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec |
25 | ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase | |
26 | ${AliRoot_SOURCE_DIR}/STEER/ESD | |
27 | ${AliRoot_SOURCE_DIR}/STEER/STEER | |
28 | ${AliRoot_SOURCE_DIR}/STEER/STEERBase | |
29 | ${AliRoot_SOURCE_DIR}/T0/T0base | |
30 | ${AliRoot_SOURCE_DIR}/TOF/TOFbase | |
31 | ${AliRoot_SOURCE_DIR}/TOF/TOFsim | |
32 | ${AliRoot_SOURCE_DIR}/TRD/TRDbase | |
33 | ${AliRoot_SOURCE_DIR}/TRD/TRDrec | |
34 | ${AliRoot_SOURCE_DIR}/VZERO/VZERObase | |
464611d8 | 35 | ) |
36 | ||
37 | # Sources in alphabetical order | |
38 | set(SRCS | |
39 | AliTRD.cxx | |
40 | AliTRDdigitizer.cxx | |
41 | AliTRDptrgCBAC.cxx | |
42 | AliTRDptrgCBB.cxx | |
43 | AliTRDptrgFEB.cxx | |
44 | AliTRDptrgLUT.cxx | |
45 | AliTRDptrgParam.cxx | |
46 | AliTRDptrgTLMU.cxx | |
47 | AliTRDQADataMakerSim.cxx | |
48 | AliTRDsimTR.cxx | |
49 | AliTRDtestG4.cxx | |
50 | AliTRDTrigger.cxx | |
51 | AliTRDTriggerL0.cxx | |
52 | AliTRDTriggerL1.cxx | |
53 | AliTRDv1.cxx | |
54 | ) | |
55 | ||
56 | # Headers from sources | |
57 | string(REPLACE ".cxx" ".h" HDRS "${SRCS}") | |
58 | ||
59 | # Generate the dictionary | |
60 | # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument | |
61 | get_directory_property(incdirs INCLUDE_DIRECTORIES) | |
62 | generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}") | |
63 | ||
9a8db893 | 64 | set(ROOT_DEPENDENCIES Core Geom Gpad Hist MathCore Physics RIO Tree VMC) |
13269fe5 | 65 | set(ALIROOT_DEPENDENCIES STEERBase STEER ESD RAWDatarec RAWDatabase TRDbase TRDrec T0base TOFbase TOFsim VZERObase) |
66 | ||
464611d8 | 67 | # Generate the ROOT map |
68 | # Dependecies | |
13269fe5 | 69 | set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES}) |
464611d8 | 70 | generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h") |
71 | ||
13269fe5 | 72 | # Create an object to be reused in case of static libraries |
73 | # Otherwise the sources will be compiled twice | |
74 | add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx) | |
139cbc46 | 75 | # Follow headers dependencies |
76 | add_dependencies(${MODULE}-object ${ALIROOT_DEPENDENCIES}) | |
13269fe5 | 77 | # Add a library to the project using the object |
78 | add_library(${MODULE} SHARED $<TARGET_OBJECTS:TRDsim-object>) | |
79 | ||
80 | # Linking | |
81 | target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES}) | |
464611d8 | 82 | |
9a8db893 | 83 | # Setting the correct headers for the object as gathered from the dependencies |
84 | target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>) | |
85 | set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>) | |
86 | ||
13269fe5 | 87 | # Public include folders that will be propagated to the dependecies |
88 | target_include_directories(${MODULE} PUBLIC ${incdirs}) | |
464611d8 | 89 | |
90 | # Additional compilation flags | |
68aeb13b | 91 | set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "") |
464611d8 | 92 | |
93 | # System dependent: Modify the way the library is build | |
94 | if(${CMAKE_SYSTEM} MATCHES Darwin) | |
95 | set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") | |
96 | endif(${CMAKE_SYSTEM} MATCHES Darwin) | |
97 | ||
98 | # Installation | |
99 | install(TARGETS ${MODULE} | |
100 | ARCHIVE DESTINATION lib | |
101 | LIBRARY DESTINATION lib) | |
102 |