Fork me on GitHub

source: git/CMakeLists.txt@ 0a88f17

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 0a88f17 was 0a88f17, checked in by William Fawcett <william.fawcett@…>, 7 years ago

bugfix to module finding order, addition of message to state if Pythia8 is found

  • Property mode set to 100644
File size: 3.3 KB
Line 
1cmake_minimum_required(VERSION 2.8)
2
3project(Delphes)
4
5set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DDROP_CGAL")
6set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
7
8# Set the runtime path of the libraries by default but allow to switch it off:
9option(SET_RPATH "Set runtime path of the ${project} libraries?" ON)
10IF(SET_RPATH)
11 # Set up the RPATH so executables find the libraries even when installed in non-default location
12 SET(CMAKE_MACOSX_RPATH 1)
13 SET(CMAKE_SKIP_BUILD_RPATH FALSE)
14 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
15 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
16
17 # Add the automatically determined parts of the RPATH which point to directories outside
18 # the build tree to the install RPATH
19 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
20
21 # the RPATH to be used when installing, but only if it's not a system directory
22 LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
23 IF(${isSystemDir} EQUAL -1)
24 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
25 ENDIF(${isSystemDir} EQUAL -1)
26ENDIF(SET_RPATH)
27
28# WJF: add path to place where Find*.cmake files can be found (for external libraries)
29set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
30
31# Declare ROOT dependency
32find_package(ROOT COMPONENTS EG Eve Geom Gui GuiHtml GenVector Hist Physics Matrix Graf RIO Tree Gpad RGL MathCore)
33include(${ROOT_USE_FILE})
34
35# WJF: Declare TrickTrack dependency
36find_package(tricktrack)
37include_directories(${tricktrack_INCLUDE_DIR})
38
39# WJF: Declare Eigen dependency
40include_directories($ENV{EIGEN_INCLUDE_DIR})
41
42# WJF: Declare Pythia8 dependancy
43find_package(Pythia8)
44if(PYTHIA8_FOUND)
45 message(STATUS "Pythia8 found")
46 include_directories(${PYTHIA8_INCLUDE_DIRS})
47 set(LIBS ${LIBS} ${PYTHIA8_LIBRARIES})
48endif(PYTHIA8_FOUND)
49
50
51if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
52 set(CMAKE_INSTALL_LIBDIR "lib")
53endif()
54
55function(DELPHES_GENERATE_DICTIONARY dictionary)
56 if(${ROOT_VERSION} LESS 6.0)
57 ROOT_GENERATE_DICTIONARY(${dictionary} ${ARGN})
58 else()
59 ROOT_GENERATE_DICTIONARY(${dictionary} MODULE ${dictionary} ${ARGN})
60 endif()
61endfunction()
62
63
64
65# Declare position of all other externals needed
66set(DelphesExternals_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external)
67
68add_subdirectory(classes)
69add_subdirectory(converters)
70add_subdirectory(display)
71add_subdirectory(examples)
72add_subdirectory(external)
73add_subdirectory(modules)
74add_subdirectory(readers)
75add_subdirectory(cards)
76add_subdirectory(analysis) # WJF: add for my analysis code
77
78add_library(Delphes SHARED
79 $<TARGET_OBJECTS:classes>
80 $<TARGET_OBJECTS:modules>
81 $<TARGET_OBJECTS:ExRootAnalysis>
82 $<TARGET_OBJECTS:fastjet>
83 $<TARGET_OBJECTS:tcl>
84 $<TARGET_OBJECTS:Hector>
85 $<TARGET_OBJECTS:PUPPI>
86)
87
88add_library(DelphesDisplay SHARED
89 $<TARGET_OBJECTS:classes>
90 $<TARGET_OBJECTS:display>
91 $<TARGET_OBJECTS:modules>
92 $<TARGET_OBJECTS:ExRootAnalysis>
93 $<TARGET_OBJECTS:fastjet>
94 $<TARGET_OBJECTS:tcl>
95 $<TARGET_OBJECTS:Hector>
96 $<TARGET_OBJECTS:PUPPI>
97)
98
99target_link_Libraries(Delphes ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
100target_link_Libraries(DelphesDisplay ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
101if(PYTHIA8_FOUND)
102 target_link_libraries(Delphes ${LIBS}) #WJF: add (needed for DelphesPythia8)
103endif(PYTHIA8_FOUND)
104
105
106install(TARGETS Delphes DelphesDisplay DESTINATION lib)
Note: See TracBrowser for help on using the repository browser.