-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
101 lines (68 loc) · 3 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
########################################################
# cmake file for building PandoraMonitoring
# @author Jan Engels, DESY
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2 FATAL_ERROR)
########################################################
# project name
PROJECT( PandoraMonitoring )
# project version
SET( PandoraMonitoring_VERSION_MAJOR 0 )
SET( PandoraMonitoring_VERSION_MINOR 17 )
SET( PandoraMonitoring_VERSION_PATCH 0 )
### CMAKE ###################################################################
FIND_PACKAGE( ILCUTIL COMPONENTS ILCSOFT_CMAKE_MODULES QUIET )
IF( ILCUTIL_FOUND )
INCLUDE( ilcsoft_default_settings )
ELSE()
INCLUDE( Default_settings )
ENDIF()
### SOURCE ##################################################################
#include directories
INCLUDE_DIRECTORIES( ./include )
INSTALL_DIRECTORY( ./include DESTINATION . FILES_MATCHING PATTERN "*.h" )
AUX_SOURCE_DIRECTORY( ./src/ PandoraMonitoring_SRCS )
ADD_DEFINITIONS( "-DMONITORING" )
# require proper C++
ADD_DEFINITIONS( "-Wall -ansi -pedantic" )
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
message( STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++11 support." )
ADD_DEFINITIONS( "-std=c++11" )
else()
message( STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Some functionality will be limited." )
endif()
# need long long for int64 for now
ADD_DEFINITIONS( "-Wno-long-long -Wno-sign-compare -fno-strict-aliasing" )
### DEPENDENCIES ############################################################
FIND_PACKAGE( PandoraSDK 0.17 REQUIRED )
FOREACH( pkg PandoraSDK )
IF( ${pkg}_FOUND )
INCLUDE_DIRECTORIES( ${${pkg}_INCLUDE_DIRS} )
LINK_LIBRARIES( ${${pkg}_LIBRARIES} )
ADD_DEFINITIONS ( ${${pkg}_DEFINITIONS} )
ENDIF()
ENDFOREACH()
FIND_PACKAGE( ROOT 5.26.00 REQUIRED COMPONENTS Eve Geom RGL EG ) # minimum required ROOT version
INCLUDE_DIRECTORIES( ${ROOT_INCLUDE_DIRS} )
LINK_LIBRARIES( ${ROOT_LIBRARIES} ${ROOT_COMPONENT_LIBRARIES} )
### 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 )
ELSE()
MESSAGE( STATUS "INSTALL_DOC set to OFF" )
SET( INSTALL_DOC OFF )
ENDIF()
### LIBRARY #################################################################
# add library
ADD_SHARED_LIBRARY( PandoraMonitoring ${PandoraMonitoring_SRCS} )
### INSTALL #################################################################
# install library
INSTALL_SHARED_LIBRARY( PandoraMonitoring DESTINATION lib )
# install header files
INSTALL_DIRECTORY( ./include DESTINATION . )
# display some variables and write them to cache
DISPLAY_STD_VARIABLES()
# generate and install cmake configuration files
GENERATE_PACKAGE_CONFIGURATION_FILES( PandoraMonitoringConfig.cmake PandoraMonitoringConfigVersion.cmake PandoraMonitoringLibDeps.cmake )