Fork me on GitHub

Ticket #313: delphes.patch

File delphes.patch, 7.8 KB (added by Benedikt Hegner, 10 years ago)

Patches for adding CMake support

  • external/fastjet/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}/external)
     2
     3file(GLOB sources *.cc plugins/*/*.cc contribs/Nsubjettiness/*.cc tools/*cc)
     4add_library(fastjet OBJECT ${sources})
     5
  • external/tcl/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}/external)
     2
     3file(GLOB sources *.c)
     4add_library(tcl OBJECT ${sources})
     5
  • external/ExRootAnalysis/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}/external
     2                    ${ROOT_INCLUDE_DIRS})
     3
     4file(GLOB sources *.cc)
     5file(GLOB headers *h)
     6list(REMOVE_ITEM headers ${CMAKE_CURRENT_SOURCE_DIR}/ExRootAnalysisLinkDef.h )
     7ROOT_GENERATE_DICTIONARY(ExRootAnalysisDict ${headers} LINKDEF ExRootAnalysisLinkDef.h )
     8add_library(ExRootAnalysis OBJECT ${sources} ExRootAnalysisDict.cxx)
     9
     10# install headers needed by public Delphes headers to include/
     11install(FILES ExRootTask.h ExRootConfReader.h DESTINATION include/ExRootAnalysis)
  • external/Hector/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}/external
     2                    ${ROOT_INCLUDE_DIRS})
     3
     4file(GLOB sources *.cc)
     5add_library(Hector OBJECT ${sources})
     6
  • external/CMakeLists.txt

     
     1add_subdirectory(fastjet)
     2add_subdirectory(ExRootAnalysis)
     3add_subdirectory(Hector)
     4add_subdirectory(tcl)
  • readers/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}
     2                    ${DelphesExternals_INCLUDE_DIR}
     3)
     4
     5# add only selected executables as targets
     6# TODO: implement switches to enable the other executables
     7set(executables DelphesHepMC.cpp DelphesLHEF.cpp)
     8
     9foreach( sourcefile ${executables} )
     10    string( REPLACE ".cpp" "" name ${sourcefile} )
     11    add_executable( ${name} ${sourcefile} )
     12    target_link_libraries( ${name} Delphes )
     13    install(TARGETS ${name} DESTINATION bin)
     14endforeach( sourcefile ${executables} )
     15
     16
  • converters/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}
     2                    ${DelphesExternals_INCLUDE_DIR}
     3)
     4
     5# add all executables as targets
     6file(GLOB executables RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
     7foreach( sourcefile ${executables} )
     8    string( REPLACE ".cpp" "" name ${sourcefile} )
     9    add_executable( ${name} ${sourcefile} )
     10    target_link_libraries( ${name} Delphes )
     11    install(TARGETS ${name} DESTINATION bin)
     12endforeach( sourcefile ${executables} )
     13
     14
  • classes/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}
     2                    ${ROOT_INCLUDE_DIRS}
     3                    ${DelphesExternals_INCLUDE_DIR}
     4)
     5
     6file(GLOB sources *.cc)
     7file(GLOB headers *h)
     8list(REMOVE_ITEM headers ${CMAKE_CURRENT_SOURCE_DIR}/ClassesLinkDef.h )
     9
     10ROOT_GENERATE_DICTIONARY(ClassesDict
     11  ${CMAKE_CURRENT_SOURCE_DIR}/DelphesModule.h
     12  ${CMAKE_CURRENT_SOURCE_DIR}/DelphesFactory.h
     13  ${CMAKE_CURRENT_SOURCE_DIR}/SortableObject.h
     14  ${CMAKE_CURRENT_SOURCE_DIR}/DelphesClasses.h
     15  LINKDEF ClassesLinkDef.h
     16)
     17
     18add_library(classes OBJECT ${sources} ClassesDict.cxx)
     19
     20#install public headers
     21install(FILES ${headers} DESTINATION include/classes)
     22
     23
  • display/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}
     2                    ${ROOT_INCLUDE_DIRS}
     3                    ${DelphesExternals_INCLUDE_DIR}
     4)
     5
     6file(GLOB sources *.cc)
     7file(GLOB headers *h)
     8list(REMOVE_ITEM headers ${CMAKE_CURRENT_SOURCE_DIR}/DisplayLinkDef.h )
     9ROOT_GENERATE_DICTIONARY(DisplayDict ${headers} LINKDEF DisplayLinkDef.h)
     10
     11add_library(display OBJECT ${sources} DisplayDict.cxx)
     12
  • modules/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}
     2                    ${ROOT_INCLUDE_DIRS}
     3                    ${DelphesExternals_INCLUDE_DIR}
     4)
     5
     6
     7file(GLOB sources *.cc)
     8file(GLOB headers *h)
     9list(REMOVE_ITEM headers ${CMAKE_CURRENT_SOURCE_DIR}/ModulesLinkDef.h )
     10list(REMOVE_ITEM headers ${CMAKE_CURRENT_SOURCE_DIR}/Pythia8LinkDef.h )
     11ROOT_GENERATE_DICTIONARY(ModulesDict ${headers} LINKDEF ModulesLinkDef.h)
     12
     13# TODO: implement switch to enable Pythia8 if present
     14list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/PileUpMergerPythia8.cc )
     15
     16add_library(modules OBJECT ${sources} ModulesDict.cxx)
     17
  • CMakeLists.txt

     
     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# Declare ROOT dependency
     9find_package(ROOT COMPONENTS EG Eve GenVector Hist Physics Matrix Graf RIO Tree Gpad RGL MathCore)
     10include(${ROOT_USE_FILE})
     11
     12# Declare position of all other externals needed
     13set(DelphesExternals_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external)
     14
     15add_subdirectory(classes)
     16add_subdirectory(converters)
     17add_subdirectory(display)
     18add_subdirectory(examples)
     19add_subdirectory(external)
     20add_subdirectory(modules)
     21add_subdirectory(readers)
     22
     23add_library(Delphes SHARED $<TARGET_OBJECTS:classes>
     24                           $<TARGET_OBJECTS:display>
     25                           $<TARGET_OBJECTS:modules>
     26                           $<TARGET_OBJECTS:ExRootAnalysis>
     27                           $<TARGET_OBJECTS:fastjet>
     28                           $<TARGET_OBJECTS:tcl>
     29                           $<TARGET_OBJECTS:Hector>
     30)
     31target_link_Libraries(Delphes ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
     32install(TARGETS Delphes DESTINATION lib)
  • examples/CMakeLists.txt

     
     1include_directories(${CMAKE_SOURCE_DIR}
     2                    ${DelphesExternals_INCLUDE_DIR}
     3)
     4
     5# build all executables and put them into bin/
     6file(GLOB executables RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
     7foreach( sourcefile ${executables} )
     8    string( REPLACE ".cpp" "" name ${sourcefile} )
     9    add_executable( ${name} ${sourcefile} )
     10    target_link_libraries( ${name} Delphes )
     11    install(TARGETS ${name} DESTINATION bin)
     12endforeach( sourcefile ${executables} )
     13
     14#take all other relevant files and put them into example/
     15file(GLOB macros *.C *.tcl *tfs)
     16install(FILES ${macros} DESTINATION examples)
     17
     18