]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/mftmuondep/charmonium/CMakeLists.txt
Additional help for the CMakeLists.txt file
[u/mrichter/AliRoot.git] / PWG / mftmuondep / charmonium / 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 name -> library name
17 set (MODULE PWGmftmuondepCharmonium)
18
19 # Module include folder
20 include_directories(${AliRoot_SOURCE_DIR}/PWG/mftmuondep/charmonium)
21
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}/ANALYSIS/EventMixing
26                     ${AliRoot_SOURCE_DIR}/MFT/MFTbase
27                     ${AliRoot_SOURCE_DIR}/MUON/MUONrec
28                     ${AliRoot_SOURCE_DIR}/STEER/AOD
29                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase
30                    )
31 # Sources - alphabetical order
32 set(SRCS
33     AliAnalysisTaskDimuonBackground.cxx
34    )
35
36 # Headers from sources
37 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
38
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}")
44
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}/ANALYSIS/EventMixing - EventMixing
50 set(ROOT_DEPENDENCIES Core EG Hist MathCore)
51 set(ALIROOT_DEPENDENCIES STEERBase AOD ANALYSIS ANALYSISalice EventMixing MUONrec MFTbase)
52
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")
58
59 # Creating the actual library
60 add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
61 target_link_libraries(${MODULE} ${LIBDEPS})
62
63 # Custom compilation and linking flags if needed
64 set(MODULE_COMPILE_FLAGS)
65 set(MODULE_LINK_FLAGS)
66
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}")
71
72 # Library installation
73 install(TARGETS ${MODULE}
74         ARCHIVE DESTINATION lib
75         LIBRARY DESTINATION lib)
76
77 # Headers installation
78 install(FILES ${HDRS} DESTINATION include)
79
80 # Install the macros
81 install(FILES AddTaskDimuonBackground.C DESTINATION PWG/mftmuondep/charmonium)
82
83 message(STATUS "PWG mftmuondep charmonium enabled")