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 # **************************************************************************
19 # Module include folders
20 include_directories(${AliRoot_SOURCE_DIR}/STEER/${MODULE})
22 # Additional include directories - alphabetical order except ROOT
23 include_directories(${ROOT_INCLUDE_DIRS}
24 ${AliRoot_SOURCE_DIR}/STEER/ESD
25 ${AliRoot_SOURCE_DIR}/STEER/STEERBase
28 # Sources - alphabetical order
30 AliAODBranchReplicator.cxx
44 AliAODInputHandler.cxx
46 AliAODJetEventBackground.cxx
53 AliAODPWG4ParticleCorrelation.cxx
54 AliAODPWG4Particle.cxx
69 AliNanoAODTrackMapping.cxx
72 # Sources from headers
73 string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
75 # Generate the dictionary
76 # It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
77 get_directory_property(incdirs INCLUDE_DIRECTORIES)
78 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
80 # ROOT and other AliRoot depencies
81 # Used to create the root maps and for the actual linking
82 set(ROOT_DEPENDENCIES Core EG Geom Hist MathCore Matrix Net Physics RIO Tree)
83 set(ALIROOT_DEPENDENCIES ESD STEERBase)
85 # Generate the ROOT map
87 set(LIBDEPS ${ROOT_DEPENDENCIES} ${ALIROOT_DEPENDENCIES})
88 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
90 # Create an object to be reused in case of static libraries
91 # Otherwise the sources will be compiled twice
92 add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
93 # Add a library to the project using the object
94 add_library(${MODULE} SHARED $<TARGET_OBJECTS:AOD-object>)
97 target_link_libraries(${MODULE} ${ROOT_DEPENDENCIES} ${ALIROOT_DEPENDENCIES})
99 # Public include folders that will be propagated to the dependecies
100 target_include_directories(${MODULE} PUBLIC ${incdirs})
102 # Additional compilation flags
103 set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-O -g")
105 # System dependent: Modify the way the library is build
106 if(${CMAKE_SYSTEM} MATCHES Darwin)
107 set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
108 endif(${CMAKE_SYSTEM} MATCHES Darwin)
111 install(TARGETS ${MODULE}
112 ARCHIVE DESTINATION lib
113 LIBRARY DESTINATION lib)
114 install(FILES ${HDRS} DESTINATION include)
116 # Static version if DA enabled
118 add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:AOD-object>)
119 set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
121 # list of shared dependencies / the name of the variable containing the list of static ones
122 generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
124 # Public include folders that will be propagated to the dependecies
125 target_include_directories(${MODULE}-static PUBLIC ${incdirs})
127 target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root RootExtra)
128 set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
131 install(TARGETS ${MODULE}-static
132 ARCHIVE DESTINATION lib
133 LIBRARY DESTINATION lib)
134 endif(ALIROOT_STATIC)