]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGUD/selectors/CMakeLists.txt
Finishing PWGUD
[u/mrichter/AliRoot.git] / PWGUD / selectors / CMakeLists.txt
CommitLineData
9620774e 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 PWGUDselectors)
18
19# Module include folder
20include_directories(${AliRoot_SOURCE_DIR}/PWGUD/selectors
21 ${AliRoot_SOURCE_DIR}/PWGUD/selectors/dNdEta
22 ${AliRoot_SOURCE_DIR}/PWGUD/selectors/eventStat
23 ${AliRoot_SOURCE_DIR}/PWGUD/selectors/multiplicity
24 ${AliRoot_SOURCE_DIR}/PWGUD/selectors/trigger
25 )
26
27# Additional include folders in alphabetical order except ROOT
28include_directories(${ROOT_INCLUDE_DIRS}
29 ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSIS
30 ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSISalice
31 ${AliRoot_SOURCE_DIR}/PWGUD/base
32 ${AliRoot_SOURCE_DIR}/STEER/ESD
33 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
34 )
35
36# Sources in alphabetical order
37set(SRCS
38 dNdEta/AlidNdEtaCorrectionTask.cxx
39 dNdEta/AlidNdEtaTask.cxx
40 eventStats/AliEventStatsTask.cxx
41 multiplicity/AliMultiplicityTask.cxx
42 trigger/AliTriggerTask.cxx
43 )
44
45# Headers from sources
46string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
47
48# Generate the dictionary
49# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
50get_directory_property(incdirs INCLUDE_DIRECTORIES)
51generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
52
53set(ROOT_DEPENDENCIES Core EG Gpad Hist MathCore Physics RIO Tree)
54set(ALIROOT_DEPENDENCIES ANALYSIS ANALYSISalice ESD STEERBase PWGUDbase)
55
56# Generate the ROOT map
57# Dependecies
58set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
59generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
60
61# Create an object to be reused in case of static libraries
62# Otherwise the sources will be compiled twice
63add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
64# Add a library to the project using the object
65add_library(${MODULE} SHARED $<TARGET_OBJECTS:${MODULE}-object>)
66target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
67
68# Setting the correct headers for the object as gathered from the dependencies
69target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
70set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
71
72# Public include folders that will be propagated to the dependecies
73target_include_directories(${MODULE} PUBLIC ${incdirs})
74
75set(MODULE_COMPILE_FLAGS)
76set(MODULE_LINK_FLAGS)
77
78if(DATE_FOUND)
79 set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS}")
80 set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${DATE_LIBS}")
81endif(DATE_FOUND)
82
83# Additional compilation and linking flags
84set(MODULE_COMPILE_FLAGS " ${MODULE_COMPILE_FLAGS}")
85
86# System dependent: Modify the way the library is build
87if(${CMAKE_SYSTEM} MATCHES Darwin)
88 set(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}")
89endif(${CMAKE_SYSTEM} MATCHES Darwin)
90
91# Setting compilation flags for the object
92set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
93# Setting the linking flags for the library
94set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
95
96# Installation
97install(TARGETS ${MODULE}
98 ARCHIVE DESTINATION lib
99 LIBRARY DESTINATION lib)
100
101install(FILES ${HDRS} DESTINATION include)