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 # **************************************************************************
16 # Module name -> library name
17 set (MODULE PWGmftmuondepCharmonium)
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/PWG/mftmuondep/charmonium)
22 # Aditional include directories in alphabetical order
23 include_directories(${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSIS
24 ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSISalice
25 ${AliRoot_SOURCE_DIR}/EVENTMIX
26 ${AliRoot_SOURCE_DIR}/MFT/MFTbase
27 ${AliRoot_SOURCE_DIR}/MUON/MUONrec
28 ${AliRoot_SOURCE_DIR}/STEER/AOD
29 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
31 # Sources - alphabetical order
33 AliAnalysisTaskDimuonBackground.cxx
36 # Headers from sources
37 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
39 # Generate the dictionary
40 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
41 # It expect the name of the LinkDef file to be ${MODULE}LinkDef.h
42 get_directory_property(incdirs INCLUDE_DIRECTORIES)
43 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
45 # VERY IMPORTANT - ADD the correct dependecies
46 # Seach any Root class you use inside the ROOT rootmaps and add Root library to the dependency
47 # AliRoot classes are usually located in the name of the include
48 # Ex: ${AliRoot_SOURCE_DIR}/ANALYSIS/ANALYSIS -> ANALYSIS
49 # ${AliRoot_SOURCE_DIR}/EVENTMIX - EventMixing
50 set(ROOT_DEPENDENCIES Core EG Hist MathCore)
51 set(ALIROOT_DEPENDENCIES STEERBase AOD ANALYSIS ANALYSISalice EventMixing MUONrec MFTbase)
53 # Generate the ROOT map used to automatically load the dependecies
54 # Load only the upper level libraries, there is no need to load the dependecies
55 # If symbols are not found it means that the dependecies are not correctly defined
56 set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
57 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
59 # Creating the actual library
60 add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
61 target_link_libraries(${MODULE} ${LIBDEPS})
63 # Custom compilation and linking flags if needed
64 set(MODULE_COMPILE_FLAGS)
65 set(MODULE_LINK_FLAGS)
67 # Setting custom compilation flags for the object
68 set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "${MODULE_COMPILE_FLAGS}")
69 # Setting customlinking flags for the library
70 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
72 # System dependent: Modify the way the library is build
73 if(${CMAKE_SYSTEM} MATCHES Darwin)
74 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
75 endif(${CMAKE_SYSTEM} MATCHES Darwin)
77 # Library installation
78 install(TARGETS ${MODULE}
79 ARCHIVE DESTINATION lib
80 LIBRARY DESTINATION lib)
82 # Headers installation
83 install(FILES ${HDRS} DESTINATION include)
86 install(FILES AddTaskDimuonBackground.C DESTINATION PWG/mftmuondep/charmonium)
88 message(STATUS "PWG mftmuondep charmonium enabled")