[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 |
|
---|
[7fe06d6] | 28 | # Declare ROOT dependency
|
---|
[341c4db] | 29 | find_package(ROOT COMPONENTS EG Eve Geom Gui GuiHtml GenVector Hist Physics Matrix Graf RIO Tree Gpad RGL MathCore)
|
---|
[7fe06d6] | 30 | include(${ROOT_USE_FILE})
|
---|
| 31 |
|
---|
[be6c1c8] | 32 | if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
---|
| 33 | set(CMAKE_INSTALL_LIBDIR "lib")
|
---|
| 34 | endif()
|
---|
| 35 |
|
---|
| 36 | function(DELPHES_GENERATE_DICTIONARY dictionary)
|
---|
| 37 | if(${ROOT_VERSION} LESS 6.0)
|
---|
| 38 | ROOT_GENERATE_DICTIONARY(${dictionary} ${ARGN})
|
---|
| 39 | else()
|
---|
| 40 | ROOT_GENERATE_DICTIONARY(${dictionary} MODULE ${dictionary} ${ARGN})
|
---|
| 41 | endif()
|
---|
| 42 | endfunction()
|
---|
| 43 |
|
---|
[7fe06d6] | 44 | # Declare position of all other externals needed
|
---|
| 45 | set(DelphesExternals_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external)
|
---|
| 46 |
|
---|
| 47 | add_subdirectory(classes)
|
---|
| 48 | add_subdirectory(converters)
|
---|
| 49 | add_subdirectory(display)
|
---|
| 50 | add_subdirectory(examples)
|
---|
| 51 | add_subdirectory(external)
|
---|
| 52 | add_subdirectory(modules)
|
---|
| 53 | add_subdirectory(readers)
|
---|
[764f5364] | 54 | add_subdirectory(cards)
|
---|
[7fe06d6] | 55 |
|
---|
| 56 | add_library(Delphes SHARED
|
---|
| 57 | $<TARGET_OBJECTS:classes>
|
---|
| 58 | $<TARGET_OBJECTS:modules>
|
---|
| 59 | $<TARGET_OBJECTS:ExRootAnalysis>
|
---|
| 60 | $<TARGET_OBJECTS:fastjet>
|
---|
| 61 | $<TARGET_OBJECTS:tcl>
|
---|
| 62 | $<TARGET_OBJECTS:Hector>
|
---|
[308ab1a] | 63 | $<TARGET_OBJECTS:PUPPI>
|
---|
[7fe06d6] | 64 | )
|
---|
| 65 |
|
---|
[102596a] | 66 | add_library(DelphesDisplay SHARED
|
---|
| 67 | $<TARGET_OBJECTS:classes>
|
---|
| 68 | $<TARGET_OBJECTS:display>
|
---|
| 69 | $<TARGET_OBJECTS:modules>
|
---|
| 70 | $<TARGET_OBJECTS:ExRootAnalysis>
|
---|
| 71 | $<TARGET_OBJECTS:fastjet>
|
---|
| 72 | $<TARGET_OBJECTS:tcl>
|
---|
| 73 | $<TARGET_OBJECTS:Hector>
|
---|
| 74 | $<TARGET_OBJECTS:PUPPI>
|
---|
| 75 | )
|
---|
| 76 |
|
---|
[7fe06d6] | 77 | target_link_Libraries(Delphes ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
|
---|
[102596a] | 78 | target_link_Libraries(DelphesDisplay ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
|
---|
[7fe06d6] | 79 |
|
---|
[102596a] | 80 | install(TARGETS Delphes DelphesDisplay DESTINATION lib)
|
---|