]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/ITSsim/CMakeLists.txt
Double check if SM is running added. Some redundant output removed from SM
[u/mrichter/AliRoot.git] / ITS / ITSsim / CMakeLists.txt
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 ITSsim)
18
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/ITS/${MODULE})
21
22 # Additional include folders in alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIR}
24                     ${AliRoot_SOURCE_DIR}/ITS/ITSbase
25                     ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
26                     ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
27                     ${AliRoot_SOURCE_DIR}/STEER/CDB
28                     ${AliRoot_SOURCE_DIR}/STEER/ESD
29                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase
30                     ${AliRoot_SOURCE_DIR}/STEER/STEER
31                    )
32
33 # Sources in alphabetical order
34 set(SRCS
35     AliITS.cxx
36     AliITSDetTypeSim.cxx
37     AliITSDigitizer.cxx
38     AliITSetfSDD.cxx
39     AliITSFOEfficiencySPDColumn.cxx
40     AliITSFOEfficiencySPD.cxx
41     AliITSFOGeneratorSPD.cxx
42     AliITSFONoiseSPD.cxx
43     AliITShit.cxx
44     AliITSmodule.cxx
45     AliITSQADataMakerSim.cxx
46     AliITSQASDDDataMakerSim.cxx
47     AliITSQASPDDataMakerSim.cxx
48     AliITSQASSDDataMakerSim.cxx
49     AliITSsDigitize.cxx
50     AliITSsimulation.cxx
51     AliITSsimulationFastPoints.cxx
52     AliITSsimulationSDD.cxx
53     AliITSsimulationSPD.cxx
54     AliITSsimulationSSD.cxx
55     AliITSSimuParam.cxx
56     AliITSTableSSD.cxx
57     AliITSTrigger.cxx
58     AliITSTriggerFOProcessor.cxx
59     AliITSv11.cxx
60     AliITSv11GeomCable.cxx
61     AliITSv11GeomCableFlat.cxx
62     AliITSv11GeomCableRound.cxx
63     AliITSv11Geometry.cxx
64     AliITSv11GeometrySDD.cxx
65     AliITSv11GeometrySPD.cxx
66     AliITSv11GeometrySSD.cxx
67     AliITSv11GeometrySupport.cxx
68    )
69
70 # Headers from sources
71 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
72
73 # Generate the dictionary
74 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
75 get_directory_property(incdirs INCLUDE_DIRECTORIES)
76 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
77
78 set(ROOT_DEPENDENCIES Core EG Geom Gpad Graf Hist MathCore Matrix Physics RIO Tree VMC)
79 set(ALIROOT_DEPENDENCIES CDB ESD STEERBase STEER ITSbase RAWDatabase RAWDatarec)
80
81 # Generate the ROOT map
82 # Dependecies
83 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
84 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
85
86 # Create an object to be reused in case of static libraries 
87 # Otherwise the sources will be compiled twice
88 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
89 # Add a library to the project using the object
90 add_library(${MODULE} SHARED $<TARGET_OBJECTS:${MODULE}-object>)
91
92 # linking
93 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
94
95 # Setting the correct headers for the object as gathered from the dependencies
96 target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
97 set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
98
99 # Additional compilation flags
100 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS " ")
101
102 # System dependent: Modify the way the library is build
103 if(${CMAKE_SYSTEM} MATCHES Darwin)
104     set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
105 endif(${CMAKE_SYSTEM} MATCHES Darwin)
106
107 # Installation
108 install(TARGETS ${MODULE}
109         ARCHIVE DESTINATION lib
110         LIBRARY DESTINATION lib)
111
112 install(FILES ${HDRS} DESTINATION include)
113
114 # Static version if DA enabled
115 if(ALIROOT_STATIC)
116     add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:${MODULE}-object>)
117     set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
118
119     # list of shared dependencies / the name of the variable containing the list of static ones
120     generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
121     target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root)
122     
123     # Public include folders that will be propagated to the dependecies
124     target_include_directories(${MODULE}-static PUBLIC ${incdirs})
125
126     set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
127
128     # Installation
129     install(TARGETS ${MODULE}-static
130             ARCHIVE DESTINATION lib
131             LIBRARY DESTINATION lib)
132 endif(ALIROOT_STATIC)