-
Notifications
You must be signed in to change notification settings - Fork 22
/
CMakeLists.txt
124 lines (88 loc) · 3.8 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
########################################################
# cmake file for building VTXTools
# - based on $MARLIN/example/mymarlin/CMakeLists.txt
# @author Daniel Hynds CERN-PH-LCD
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
########################################################
# project name
PROJECT( ClicPerformance )
# project version
SET( ${PROJECT_NAME}_VERSION_MAJOR 2 )
SET( ${PROJECT_NAME}_VERSION_MINOR 5 )
SET( ${PROJECT_NAME}_VERSION_PATCH 1 )
### DEPENDENCIES ############################################################
FIND_PACKAGE( ILCUTIL REQUIRED COMPONENTS ILCSOFT_CMAKE_MODULES )
# load default settings from ILCSOFT_CMAKE_MODULES
INCLUDE( ilcsoft_default_settings )
FIND_PACKAGE( ROOT 5.27 REQUIRED COMPONENTS MathMore )
INCLUDE_DIRECTORIES( SYSTEM ${ROOT_INCLUDE_DIRS} )
LINK_LIBRARIES( ${ROOT_LIBRARIES} ${ROOT_MATHMORE_LIBRARY} )
FIND_PACKAGE( MarlinUtil 1.4 REQUIRED )
FIND_PACKAGE( GSL REQUIRED )
FIND_PACKAGE( Marlin 1.0 REQUIRED ) # minimum required Marlin version
INCLUDE_DIRECTORIES( SYSTEM ${Marlin_INCLUDE_DIRS} )
LINK_LIBRARIES( ${Marlin_LIBRARIES} )
ADD_DEFINITIONS( ${Marlin_DEFINITIONS} )
INCLUDE_DIRECTORIES( BEFORE SYSTEM ${LCIO_INCLUDE_DIRS} )
FIND_PACKAGE( MarlinTrk REQUIRED )
INCLUDE_DIRECTORIES( SYSTEM ${MarlinTrk_INCLUDE_DIRS} )
LINK_LIBRARIES( ${MarlinTrk_LIBRARIES} )
ADD_DEFINITIONS( ${MarlinTrk_DEFINITIONS} )
FIND_PACKAGE( AIDA REQUIRED )
INCLUDE_DIRECTORIES( SYSTEM ${AIDA_INCLUDE_DIRS} )
LINK_LIBRARIES( ${AIDA_LIBRARIES} )
ADD_DEFINITIONS( ${AIDA_DEFINITIONS} )
find_package( DD4hep REQUIRED COMPONENTS DDRec )
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake )
include( DD4hep )
if(DD4HEP_USE_XERCESC)
find_package(XercesC)
endif()
include(DD4hep_XML_setup)
INCLUDE_DIRECTORIES( BEFORE SYSTEM ${DD4hep_INCLUDE_DIRS} )
LINK_LIBRARIES( ${DD4hep_LIBRARIES} ${DD4hep_COMPONENT_LIBRARIES} )
OPTION( MARLINRECO_AIDA "Set to ON to build MarlinReco with AIDA" ON )
IF( MARLINRECO_AIDA )
FIND_PACKAGE( AIDA )
IF( NOT AIDA_FOUND )
MESSAGE( SEND_ERROR "AIDA not found. Please set MARLINRECO_AIDA to OFF or AIDA_DIR=/path/to/AIDA" )
ENDIF()
ENDIF()
# optional package
FOREACH( pkg Marlin MarlinUtil GSL AIDA )
IF( ${pkg}_FOUND )
INCLUDE_DIRECTORIES( SYSTEM ${${pkg}_INCLUDE_DIRS} )
LINK_LIBRARIES( ${${pkg}_LIBRARIES} )
ADD_DEFINITIONS( ${${pkg}_DEFINITIONS} )
MESSAGE( STATUS "${pkg} -- found" )
ELSE()
MESSAGE( STATUS "${pkg} -- not found" )
ENDIF()
ENDFOREACH()
OPTION( VALGRIND "Set to location of valgrind" "/cvmfs/sft.cern.ch/lcg/releases/LCG_88/valgrind/3.11.0/x86_64-centos7-gcc62-opt/bin/valgrind" )
OPTION( VALGRIND_LIB "Set to location of lib[64]/valgrind" "/cvmfs/sft.cern.ch/lcg/releases/LCG_88/valgrind/3.11.0/x86_64-centos7-gcc62-opt/lib/valgrind" )
### DOCUMENTATION ###########################################################
OPTION( INSTALL_DOC "Set to OFF to skip build/install Documentation" OFF )
IF( INSTALL_DOC AND EXISTS "${PROJECT_SOURCE_DIR}/doc/CMakeLists.txt" )
ADD_SUBDIRECTORY( ./doc )
ENDIF()
### LIBRARY #################################################################
# definitions to pass to the compiler
#ADD_DEFINITIONS( "-Wall -ansi -pedantic" )
#ADD_DEFINITIONS( "-Wno-long-long" )
# include directories
INCLUDE_DIRECTORIES( ./Calorimetry/include ./Tracking/include source/Conditions/include )
# add library
AUX_SOURCE_DIRECTORY(./Calorimetry/src library_sources )
AUX_SOURCE_DIRECTORY(./Tracking/src library_sources )
AUX_SOURCE_DIRECTORY(./source/Conditions/src library_sources )
ADD_SHARED_LIBRARY( ${PROJECT_NAME} ${library_sources} )
INSTALL_SHARED_LIBRARY( ${PROJECT_NAME} DESTINATION lib )
option(BUILD_TESTING "Enable and build tests" ON)
if(BUILD_TESTING)
include(CTest)
enable_testing()
add_subdirectory(Tests)
endif(BUILD_TESTING)
# display some variables and write them to cache
DISPLAY_STD_VARIABLES()