1 # **************************************************************************
2 # * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4 # * Author: The ALICE Off-line Project. *
5 # * Contributors are mentioned in the code where appropriate. *
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 # **************************************************************************
17 set(MODULE PWGUDdiffractive)
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/PWGUD/DIFFRACTIVE
21 ${AliRoot_SOURCE_DIR}/PWGUD/DIFFRACTIVE/xsAndTwoProng
24 # Additional include folders in alphabetical order except ROOT
25 include_directories(${ROOT_INCLUDE_DIRS}
26 ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSIS
27 ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSISalice
28 ${AliRoot_SOURCE_DIR}/ITS/ITSrec
29 ${AliRoot_SOURCE_DIR}/OADB
30 ${AliRoot_SOURCE_DIR}/PWGPP/ITS
31 ${AliRoot_SOURCE_DIR}/STEER/CDB
32 ${AliRoot_SOURCE_DIR}/STEER/STEER
33 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
34 ${AliRoot_SOURCE_DIR}/VZERO/VZERObase
37 # Sources in alphabetical order
39 example/AliAnalysisTaskCDex.cxx
40 example/AliCDMesonBaseStripped.cxx
41 example/AliCDMesonUtilsStripped.cxx
42 QA/AliAnalysisTaskCPQA.cxx
43 xsAndTwoProng/AliAnalysisTaskCDMeson.cxx
44 xsAndTwoProng/AliAnalysisTaskCDskimESD.cxx
45 xsAndTwoProng/AliCDMesonBase.cxx
46 xsAndTwoProng/AliCDMesonTracks.cxx
47 xsAndTwoProng/AliCDMesonUtils.cxx
50 # Headers from sources
51 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
53 # Generate the dictionary
54 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
55 get_directory_property(incdirs INCLUDE_DIRECTORIES)
56 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
58 set(ROOT_DEPENDENCIES Core EG Geom Hist MathCore Physics RIO Tree)
59 set(ALIROOT_DEPENDENCIES STEERBase STEER CDB ANALYSISalice ANALYSIS ITSrec VZERObase PWGPP)
61 # Generate the ROOT map
63 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
64 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
66 # Create an object to be reused in case of static libraries
67 # Otherwise the sources will be compiled twice
68 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
69 # Add a library to the project using the object
70 add_library(${MODULE} SHARED $<TARGET_OBJECTS:${MODULE}-object>)
71 target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
73 # Setting the correct headers for the object as gathered from the dependencies
74 target_include_directories(${MODULE}-object PUBLIC $<TARGET_PROPERTY:${MODULE},INCLUDE_DIRECTORIES>)
75 set_target_properties(${MODULE}-object PROPERTIES COMPILE_DEFINITIONS $<TARGET_PROPERTY:${MODULE},COMPILE_DEFINITIONS>)
77 # Public include folders that will be propagated to the dependecies
78 target_include_directories(${MODULE} PUBLIC ${incdirs})
80 set(MODULE_COMPILE_FLAGS)
81 set(MODULE_LINK_FLAGS)
84 set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS}")
85 set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${DATE_LIBS}")
88 # Additional compilation and linking flags
89 set(MODULE_COMPILE_FLAGS " ${MODULE_COMPILE_FLAGS}")
91 # System dependent: Modify the way the library is build
92 if(${CMAKE_SYSTEM} MATCHES Darwin)
93 set(MODULE_LINK_FLAGS "-undefined dynamic_lookup ${MODULE_LINK_FLAGS}")
94 endif(${CMAKE_SYSTEM} MATCHES Darwin)
96 # Setting compilation flags for the object
97 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
98 # Setting the linking flags for the library
99 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
102 install(TARGETS ${MODULE}
103 ARCHIVE DESTINATION lib
104 LIBRARY DESTINATION lib)
106 install(FILES ${HDRS} DESTINATION include)
108 # Installing the macros
109 install(DIRECTORY . DESTINATION PWGUD/DIFFRACTIVE FILES_MATCHING PATTERN "*.C")