-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
103 lines (65 loc) · 3.1 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
########################################################
# cmake file for building Marlin example Package
# @author Jan Engels, Desy IT
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
########################################################
# project name
PROJECT( LCFIVertex )
# project version
SET( ${PROJECT_NAME}_VERSION_MAJOR 0 )
SET( ${PROJECT_NAME}_VERSION_MINOR 9 )
SET( ${PROJECT_NAME}_VERSION_PATCH 0 )
### DEPENDENCIES ############################################################
FIND_PACKAGE( ILCUTIL REQUIRED COMPONENTS ILCSOFT_CMAKE_MODULES )
# load default settings from ILCSOFT_CMAKE_MODULES
INCLUDE( ilcsoft_default_settings )
FIND_PACKAGE( Marlin 1.0 REQUIRED ) # minimum required Marlin version
INCLUDE_DIRECTORIES( SYSTEM ${Marlin_INCLUDE_DIRS} )
ADD_DEFINITIONS( ${Marlin_DEFINITIONS} )
FIND_PACKAGE( LCIO REQUIRED )
INCLUDE_DIRECTORIES( SYSTEM ${LCIO_INCLUDE_DIRS} )
ADD_DEFINITIONS( ${LCIO_DEFINITIONS} )
FIND_PACKAGE( MarlinUtil REQUIRED ) # minimum required Marlin version
INCLUDE_DIRECTORIES( SYSTEM ${MarlinUtil_INCLUDE_DIRS} )
# optional package
FIND_PACKAGE( AIDA )
IF( AIDA_FOUND )
INCLUDE_DIRECTORIES( SYSTEM ${AIDA_INCLUDE_DIRS} )
ADD_DEFINITIONS( "-DMARLIN_USE_AIDA" )
MESSAGE( STATUS "AIDA: ${AIDA_DIR}" )
ELSE()
MESSAGE( STATUS "AIDA -- not found" )
ENDIF()
### DOCUMENTATION ###########################################################
OPTION( INSTALL_DOC "Set to OFF to skip build/install Documentation" OFF )
IF( INSTALL_DOC )
ADD_SUBDIRECTORY( ./doc )
ENDIF()
### LIBRARY #################################################################
# -------------------- boost ------------------------------------------------------
find_package( Boost REQUIRED )
include_directories( SYSTEM ${Boost_INCLUDE_DIRS} )
SET( LCFI_USE_EXTERNAL_BOOST 1)
# ---------------------------------------------------------------------------------
# definitions to pass to the compiler
#ADD_DEFINITIONS( "-Wall -ansi -pedantic" )
#ADD_DEFINITIONS( "-Wno-long-long" )
# include directories
INCLUDE_DIRECTORIES( ./include ./vertex_lcfi ./vertex_lcfi/nnet/inc ./diagnostics/include )
INSTALL_DIRECTORY( ./vertex_lcfi DESTINATION include FILES_MATCHING PATTERN "*.h*" )
# get list of all source files
AUX_SOURCE_DIRECTORY( ./src processor_srcs )
AUX_SOURCE_DIRECTORY( ./diagnostics/src diagnostics_srcs )
FILE( GLOB_RECURSE vertex_lcfi_srcs "vertex_lcfi/*.cpp" )
SET( library_sources ${vertex_lcfi_srcs} )
# add library
ADD_SHARED_LIBRARY( ${PROJECT_NAME} ${library_sources} )
ADD_SHARED_LIBRARY( ${PROJECT_NAME}Processors ${processor_srcs} ${diagnostics_srcs} )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${Marlin_LIBRARIES} ${MarlinUtil_LIBRARIES} ${LCIO_LIBRARIES} )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME}Processors ${AIDA_LIBRARIES} ${PROJECT_NAME} )
INSTALL_SHARED_LIBRARY( ${PROJECT_NAME} DESTINATION lib )
INSTALL_SHARED_LIBRARY( ${PROJECT_NAME}Processors DESTINATION lib )
# display some variables and write them to cache
DISPLAY_STD_VARIABLES()
# generate and install following configuration files
GENERATE_PACKAGE_CONFIGURATION_FILES( ${PROJECT_NAME}Config.cmake ${PROJECT_NAME}ConfigVersion.cmake )