[7fe06d6] | 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 |
|
---|
[9c2ce8b] | 8 | # Set the runtime path of the libraries by default but allow to switch it off:
|
---|
| 9 | option(SET_RPATH "Set runtime path of the ${project} libraries?" ON)
|
---|
| 10 | IF(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)
|
---|
| 26 | ENDIF(SET_RPATH)
|
---|
| 27 |
|
---|
[8b8a46c] | 28 | # WJF: add path to place where Find*.cmake files can be found (for external libraries)
|
---|
| 29 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
---|
| 30 |
|
---|
[7fe06d6] | 31 | # Declare ROOT dependency
|
---|
[341c4db] | 32 | find_package(ROOT COMPONENTS EG Eve Geom Gui GuiHtml GenVector Hist Physics Matrix Graf RIO Tree Gpad RGL MathCore)
|
---|
[7fe06d6] | 33 | include(${ROOT_USE_FILE})
|
---|
| 34 |
|
---|
[8b8a46c] | 35 | # WJF: Declare TrickTrack dependency
|
---|
| 36 | find_package(tricktrack)
|
---|
| 37 | include_directories(${tricktrack_INCLUDE_DIR})
|
---|
| 38 |
|
---|
| 39 | # WJF: Declare Eigen dependency
|
---|
| 40 | include_directories($ENV{EIGEN_INCLUDE_DIR})
|
---|
| 41 |
|
---|
| 42 | # WJF: Declare Pythia8 dependancy
|
---|
[3283d6e] | 43 | if(PYTHIA8_FOUND)
|
---|
| 44 | find_package(Pythia8)
|
---|
| 45 | include_directories(${PYTHIA8_INCLUDE_DIRS})
|
---|
| 46 | set(LIBS ${LIBS} ${PYTHIA8_LIBRARIES})
|
---|
| 47 | endif(PYTHIA8_FOUND)
|
---|
[8b8a46c] | 48 |
|
---|
| 49 |
|
---|
[be6c1c8] | 50 | if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
---|
| 51 | set(CMAKE_INSTALL_LIBDIR "lib")
|
---|
| 52 | endif()
|
---|
| 53 |
|
---|
| 54 | function(DELPHES_GENERATE_DICTIONARY dictionary)
|
---|
| 55 | if(${ROOT_VERSION} LESS 6.0)
|
---|
| 56 | ROOT_GENERATE_DICTIONARY(${dictionary} ${ARGN})
|
---|
| 57 | else()
|
---|
| 58 | ROOT_GENERATE_DICTIONARY(${dictionary} MODULE ${dictionary} ${ARGN})
|
---|
| 59 | endif()
|
---|
| 60 | endfunction()
|
---|
| 61 |
|
---|
[8b8a46c] | 62 |
|
---|
| 63 |
|
---|
[7fe06d6] | 64 | # Declare position of all other externals needed
|
---|
| 65 | set(DelphesExternals_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external)
|
---|
| 66 |
|
---|
| 67 | add_subdirectory(classes)
|
---|
| 68 | add_subdirectory(converters)
|
---|
| 69 | add_subdirectory(display)
|
---|
| 70 | add_subdirectory(examples)
|
---|
| 71 | add_subdirectory(external)
|
---|
| 72 | add_subdirectory(modules)
|
---|
| 73 | add_subdirectory(readers)
|
---|
[764f5364] | 74 | add_subdirectory(cards)
|
---|
[3283d6e] | 75 | add_subdirectory(analysis) # WJF: add for my analysis code
|
---|
[7fe06d6] | 76 |
|
---|
| 77 | add_library(Delphes SHARED
|
---|
| 78 | $<TARGET_OBJECTS:classes>
|
---|
| 79 | $<TARGET_OBJECTS:modules>
|
---|
| 80 | $<TARGET_OBJECTS:ExRootAnalysis>
|
---|
| 81 | $<TARGET_OBJECTS:fastjet>
|
---|
| 82 | $<TARGET_OBJECTS:tcl>
|
---|
| 83 | $<TARGET_OBJECTS:Hector>
|
---|
[308ab1a] | 84 | $<TARGET_OBJECTS:PUPPI>
|
---|
[7fe06d6] | 85 | )
|
---|
| 86 |
|
---|
[102596a] | 87 | add_library(DelphesDisplay SHARED
|
---|
| 88 | $<TARGET_OBJECTS:classes>
|
---|
| 89 | $<TARGET_OBJECTS:display>
|
---|
| 90 | $<TARGET_OBJECTS:modules>
|
---|
| 91 | $<TARGET_OBJECTS:ExRootAnalysis>
|
---|
| 92 | $<TARGET_OBJECTS:fastjet>
|
---|
| 93 | $<TARGET_OBJECTS:tcl>
|
---|
| 94 | $<TARGET_OBJECTS:Hector>
|
---|
| 95 | $<TARGET_OBJECTS:PUPPI>
|
---|
| 96 | )
|
---|
| 97 |
|
---|
[7fe06d6] | 98 | target_link_Libraries(Delphes ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
|
---|
[102596a] | 99 | target_link_Libraries(DelphesDisplay ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
|
---|
[3283d6e] | 100 | if(PYTHIA8_FOUND)
|
---|
| 101 | target_link_libraries(Delphes ${LIBS}) #WJF: add (needed for DelphesPythia8)
|
---|
| 102 | endif(PYTHIA8_FOUND)
|
---|
[8b8a46c] | 103 |
|
---|
[7fe06d6] | 104 |
|
---|
[102596a] | 105 | install(TARGETS Delphes DelphesDisplay DESTINATION lib)
|
---|