Fork me on GitHub

source: git/CMakeLists.txt@ 84d3193

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 84d3193 was 84d3193, checked in by Simon Spannagel <simon.spannagel@…>, 8 years ago

CMake: compare integers instead of strings

  • Property mode set to 100644
File size: 2.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 up the RPATH so executables find the libraries even when installed in non-default location
9SET(CMAKE_MACOSX_RPATH 1)
10SET(CMAKE_SKIP_BUILD_RPATH FALSE)
11SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
12SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
13
14# Add the automatically determined parts of the RPATH which point to directories outside
15# the build tree to the install RPATH
16SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
17
18# the RPATH to be used when installing, but only if it's not a system directory
19LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
20IF(${isSystemDir} EQUAL -1)
21 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
22ENDIF(${isSystemDir} EQUAL -1)
23
24# Declare ROOT dependency
25find_package(ROOT COMPONENTS EG Eve Geom Gui GuiHtml GenVector Hist Physics Matrix Graf RIO Tree Gpad RGL MathCore)
26include(${ROOT_USE_FILE})
27
28if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
29 set(CMAKE_INSTALL_LIBDIR "lib")
30endif()
31
32function(DELPHES_GENERATE_DICTIONARY dictionary)
33 if(${ROOT_VERSION} LESS 6.0)
34 ROOT_GENERATE_DICTIONARY(${dictionary} ${ARGN})
35 else()
36 ROOT_GENERATE_DICTIONARY(${dictionary} MODULE ${dictionary} ${ARGN})
37 endif()
38endfunction()
39
40# Declare position of all other externals needed
41set(DelphesExternals_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external)
42
43add_subdirectory(classes)
44add_subdirectory(converters)
45add_subdirectory(display)
46add_subdirectory(examples)
47add_subdirectory(external)
48add_subdirectory(modules)
49add_subdirectory(readers)
50add_subdirectory(cards)
51
52add_library(Delphes SHARED
53 $<TARGET_OBJECTS:classes>
54 $<TARGET_OBJECTS:modules>
55 $<TARGET_OBJECTS:ExRootAnalysis>
56 $<TARGET_OBJECTS:fastjet>
57 $<TARGET_OBJECTS:tcl>
58 $<TARGET_OBJECTS:Hector>
59 $<TARGET_OBJECTS:PUPPI>
60)
61
62add_library(DelphesDisplay SHARED
63 $<TARGET_OBJECTS:classes>
64 $<TARGET_OBJECTS:display>
65 $<TARGET_OBJECTS:modules>
66 $<TARGET_OBJECTS:ExRootAnalysis>
67 $<TARGET_OBJECTS:fastjet>
68 $<TARGET_OBJECTS:tcl>
69 $<TARGET_OBJECTS:Hector>
70 $<TARGET_OBJECTS:PUPPI>
71)
72
73target_link_Libraries(Delphes ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
74target_link_Libraries(DelphesDisplay ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES})
75
76install(TARGETS Delphes DelphesDisplay DESTINATION lib)
Note: See TracBrowser for help on using the repository browser.