1 | cmake_minimum_required(VERSION 2.8)
|
---|
2 |
|
---|
3 | project(Delphes)
|
---|
4 |
|
---|
5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DDROP_CGAL")
|
---|
6 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
---|
7 |
|
---|
8 | # Set up the RPATH so executables find the libraries even when installed in non-default location
|
---|
9 | SET(CMAKE_MACOSX_RPATH 1)
|
---|
10 | SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
---|
11 | SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
---|
12 | SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
---|
13 |
|
---|
14 | # Add the automatically determined parts of the RPATH which point to directories outside
|
---|
15 | # the build tree to the install RPATH
|
---|
16 | SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
---|
17 |
|
---|
18 | # the RPATH to be used when installing, but only if it's not a system directory
|
---|
19 | LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
---|
20 | IF(${isSystemDir} EQUAL -1)
|
---|
21 | SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
---|
22 | ENDIF(${isSystemDir} EQUAL -1)
|
---|
23 |
|
---|
24 | # Declare ROOT dependency
|
---|
25 | find_package(ROOT COMPONENTS EG Eve Geom Gui GuiHtml GenVector Hist Physics Matrix Graf RIO Tree Gpad RGL MathCore)
|
---|
26 | include(${ROOT_USE_FILE})
|
---|
27 |
|
---|
28 | if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
---|
29 | set(CMAKE_INSTALL_LIBDIR "lib")
|
---|
30 | endif()
|
---|
31 |
|
---|
32 | function(DELPHES_GENERATE_DICTIONARY dictionary)
|
---|
33 | if(${ROOT_VERSION} LESS 6.0)
|
---|
34 | ROOT_GENERATE_DICTIONARY(${dictionary} ${ARGN})
|
---|
35 | else()
|
---|
36 | ROOT_GENERATE_DICTIONARY(${dictionary} MODULE ${dictionary} ${ARGN})
|
---|
37 | endif()
|
---|
38 | endfunction()
|
---|
39 |
|
---|
40 | # Declare position of all other externals needed
|
---|
41 | set(DelphesExternals_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external)
|
---|
42 |
|
---|
43 | add_subdirectory(classes)
|
---|
44 | add_subdirectory(converters)
|
---|
45 | add_subdirectory(display)
|
---|
46 | add_subdirectory(examples)
|
---|
47 | add_subdirectory(external)
|
---|
48 | add_subdirectory(modules)
|
---|
49 | add_subdirectory(readers)
|
---|
50 | add_subdirectory(cards)
|
---|
51 |
|
---|
52 | add_library(Delphes SHARED
|
---|
53 | $<TARGET_OBJECTS:classes>
|
---|
54 | $<TARGET_OBJECTS:modules>
|
---|
55 | $<TARGET_OBJECTS:ExRootAnalysis>
|
---|
56 | $<TARGET_OBJECTS:fastjet>
|
---|
57 | $<TARGET_OBJECTS:tcl>
|
---|
58 | $<TARGET_OBJECTS:Hector>
|
---|
59 | $<TARGET_OBJECTS:PUPPI>
|
---|
60 | )
|
---|
61 |
|
---|
62 | add_library(DelphesDisplay SHARED
|
---|
63 | $<TARGET_OBJECTS:classes>
|
---|
64 | $<TARGET_OBJECTS:display>
|
---|
65 | $<TARGET_OBJECTS:modules>
|
---|
66 | $<TARGET_OBJECTS:ExRootAnalysis>
|
---|
67 | $<TARGET_OBJECTS:fastjet>
|
---|
68 | $<TARGET_OBJECTS:tcl>
|
---|
69 | $<TARGET_OBJECTS:Hector>
|
---|
70 | $<TARGET_OBJECTS:PUPPI>
|
---|
71 | )
|
---|
72 |
|
---|
73 | target_link_Libraries(Delphes ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
|
---|
74 | target_link_Libraries(DelphesDisplay ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
|
---|
75 |
|
---|
76 | install(TARGETS Delphes DelphesDisplay DESTINATION lib)
|
---|