Split: fixed incpaths for ANALYSISalice -> OADB
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / 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 PWGGAGammaConv)
18
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/PWGGA/GammaConv)
21
22 # Additional include folders in alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIRS}
24                     ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSIS
25                     ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSISalice
26                     ${AliRoot_SOURCE_DIR}/EMCAL/EMCALUtils
27                     ${AliRoot_SOURCE_DIR}/EMCAL/EMCALbase
28                     ${AliRoot_SOURCE_DIR}/OADB
29                     ${AliRoot_SOURCE_DIR}/PWGCF/FLOW/Tasks # what target here
30                     ${AliRoot_SOURCE_DIR}/PWG/EMCAL
31                     ${AliRoot_SOURCE_DIR}/PWG/FLOW
32                     ${AliRoot_SOURCE_DIR}/PWG/TRD
33                     ${AliRoot_SOURCE_DIR}/STEER/AOD
34                     ${AliRoot_SOURCE_DIR}/STEER/ESD
35                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase
36                    )
37
38 # Sources in alphabetical order
39 set(SRCS
40     AliAnaConvCorrBase.cxx
41     AliAnaConvCorrPhoton.cxx
42     AliAnaConvCorrPion.cxx
43     AliAnaConvIsolation.cxx
44     AliAnalysisTaskConversionQA.cxx
45     AliAnalysisTaskdPhi.cxx
46     AliAnalysisTaskEtaToPiPlPiMiGamma.cxx
47     AliAnalysisTaskGammaCalo.cxx
48     AliAnalysisTaskGammaConvCalo.cxx
49     AliAnalysisTaskGammaConvDalitzV1.cxx
50     AliAnalysisTaskGammaConvFlow.cxx
51     AliAnalysisTaskGammaConvV1.cxx
52     AliAnalysisTaskGCPartToPWG4Part.cxx
53     AliAnalysisTaskMaterial.cxx
54     AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero.cxx
55     AliAnalysisTaskPi0v2.cxx
56     AliAnalysisTaskResolution.cxx
57     AliAODConversionMother.cxx
58     AliAODConversionParticle.cxx
59     AliAODConversionPhoton.cxx
60     AliCaloPhotonCuts.cxx
61     AliConversionAODBGHandlerRP.cxx
62     AliConversionCuts.cxx
63     AliConversionMesonCuts.cxx
64     AliConversionPhotonBase.cxx
65     AliConversionPhotonCuts.cxx
66     AliConversionSelection.cxx
67     AliConversionTrackCuts.cxx
68     AliConvEventCuts.cxx
69     AliDalitzElectronCuts.cxx
70     AliDalitzElectronSelector.cxx
71     AliGammaConversionAODBGHandler.cxx
72     AliKFConversionMother.cxx
73     AliKFConversionPhoton.cxx
74     AliPrimaryPionCuts.cxx
75     AliPrimaryPionSelector.cxx
76     AliV0ReaderV1.cxx
77    )
78
79 # Headers from sources
80 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
81
82 # Generate the dictionary
83 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
84 get_directory_property(incdirs INCLUDE_DIRECTORIES)
85 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
86
87 set(ROOT_DEPENDENCIES Core EG GenVector Geom Gpad Hist MathCore Matrix Net Physics RIO Tree)
88 set(ALIROOT_DEPENDENCIES ANALYSIS ANALYSISalice AOD EMCALbase EMCALUtils ESD STEERBase PWGTRD PWGflowTasks)
89
90 # Generate the ROOT map
91 # Dependecies
92 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
93 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
94
95 # Create an object to be reused in case of static libraries 
96 # Otherwise the sources will be compiled twice
97 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
98 # Add a library to the project using the object
99 add_library(${MODULE} SHARED $<TARGET_OBJECTS:${MODULE}-object>)
100 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
101
102 # Setting the correct headers for the object as gathered from the dependencies
103 target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
104 set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
105
106 # Public include folders that will be propagated to the dependecies
107 target_include_directories(${MODULE} PUBLIC ${incdirs})
108
109 set(MODULE_COMPILE_FLAGS)
110 set(MODULE_LINK_FLAGS)
111
112 if(DATE_FOUND)
113     set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS}")
114     set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${DATE_LIBS}")
115 endif(DATE_FOUND)
116
117 # Additional compilation and linking flags
118 set(MODULE_COMPILE_FLAGS " ${MODULE_COMPILE_FLAGS}")
119
120 # System dependent: Modify the way the library is build
121 if(${CMAKE_SYSTEM} MATCHES Darwin)
122     set(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}")
123 endif(${CMAKE_SYSTEM} MATCHES Darwin)
124
125 # Setting compilation flags for the object
126 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
127 # Setting the linking flags for the library
128 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
129
130 # Installation
131 install(TARGETS ${MODULE}
132         ARCHIVE DESTINATION lib
133         LIBRARY DESTINATION lib)
134
135 install(FILES ${HDRS} DESTINATION include)
136
137 # install macros
138 install(DIRECTORY macros DESTINATION PWGGA/GammaConv)