[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 |
|
---|
[5528bfe] | 28 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
---|
[8b8a46c] | 29 |
|
---|
[7fe06d6] | 30 | # Declare ROOT dependency
|
---|
[341c4db] | 31 | find_package(ROOT COMPONENTS EG Eve Geom Gui GuiHtml GenVector Hist Physics Matrix Graf RIO Tree Gpad RGL MathCore)
|
---|
[7fe06d6] | 32 | include(${ROOT_USE_FILE})
|
---|
| 33 |
|
---|
[4ed4118] | 34 | # Declare Pythia8 dependancy
|
---|
[0a88f17] | 35 | find_package(Pythia8)
|
---|
[3283d6e] | 36 | if(PYTHIA8_FOUND)
|
---|
| 37 | include_directories(${PYTHIA8_INCLUDE_DIRS})
|
---|
[3874a9c] | 38 | endif()
|
---|
[8b8a46c] | 39 |
|
---|
[be6c1c8] | 40 | if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
---|
| 41 | set(CMAKE_INSTALL_LIBDIR "lib")
|
---|
| 42 | endif()
|
---|
| 43 |
|
---|
| 44 | function(DELPHES_GENERATE_DICTIONARY dictionary)
|
---|
| 45 | if(${ROOT_VERSION} LESS 6.0)
|
---|
| 46 | ROOT_GENERATE_DICTIONARY(${dictionary} ${ARGN})
|
---|
| 47 | else()
|
---|
| 48 | ROOT_GENERATE_DICTIONARY(${dictionary} MODULE ${dictionary} ${ARGN})
|
---|
| 49 | endif()
|
---|
| 50 | endfunction()
|
---|
| 51 |
|
---|
[7fe06d6] | 52 | # Declare position of all other externals needed
|
---|
| 53 | set(DelphesExternals_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external)
|
---|
| 54 |
|
---|
| 55 | add_subdirectory(classes)
|
---|
| 56 | add_subdirectory(converters)
|
---|
| 57 | add_subdirectory(display)
|
---|
| 58 | add_subdirectory(examples)
|
---|
| 59 | add_subdirectory(external)
|
---|
| 60 | add_subdirectory(modules)
|
---|
| 61 | add_subdirectory(readers)
|
---|
[764f5364] | 62 | add_subdirectory(cards)
|
---|
[7fe06d6] | 63 |
|
---|
| 64 | add_library(Delphes SHARED
|
---|
| 65 | $<TARGET_OBJECTS:classes>
|
---|
| 66 | $<TARGET_OBJECTS:modules>
|
---|
| 67 | $<TARGET_OBJECTS:ExRootAnalysis>
|
---|
| 68 | $<TARGET_OBJECTS:fastjet>
|
---|
| 69 | $<TARGET_OBJECTS:tcl>
|
---|
| 70 | $<TARGET_OBJECTS:Hector>
|
---|
[308ab1a] | 71 | $<TARGET_OBJECTS:PUPPI>
|
---|
[ccea85b] | 72 | $<TARGET_OBJECTS:TrackCovariance>
|
---|
[7fe06d6] | 73 | )
|
---|
| 74 |
|
---|
[102596a] | 75 | add_library(DelphesDisplay SHARED
|
---|
| 76 | $<TARGET_OBJECTS:classes>
|
---|
| 77 | $<TARGET_OBJECTS:display>
|
---|
| 78 | $<TARGET_OBJECTS:modules>
|
---|
| 79 | $<TARGET_OBJECTS:ExRootAnalysis>
|
---|
| 80 | $<TARGET_OBJECTS:fastjet>
|
---|
| 81 | $<TARGET_OBJECTS:tcl>
|
---|
| 82 | $<TARGET_OBJECTS:Hector>
|
---|
| 83 | $<TARGET_OBJECTS:PUPPI>
|
---|
[ccea85b] | 84 | $<TARGET_OBJECTS:TrackCovariance>
|
---|
[102596a] | 85 | )
|
---|
| 86 |
|
---|
[7fe06d6] | 87 | target_link_Libraries(Delphes ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
|
---|
[102596a] | 88 | target_link_Libraries(DelphesDisplay ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
|
---|
[3874a9c] | 89 |
|
---|
[3283d6e] | 90 | if(PYTHIA8_FOUND)
|
---|
[b315535] | 91 | target_link_libraries(Delphes ${PYTHIA8_LIBRARIES} ${CMAKE_DL_LIBS})
|
---|
[3d778cd] | 92 | target_link_libraries(DelphesDisplay ${PYTHIA8_LIBRARIES} ${CMAKE_DL_LIBS})
|
---|
[3874a9c] | 93 | endif()
|
---|
[7fe06d6] | 94 |
|
---|
[102596a] | 95 | install(TARGETS Delphes DelphesDisplay DESTINATION lib)
|
---|