forked from ArborPFA/MarlinArbor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
118 lines (86 loc) · 3.88 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
########################################################
# cmake file for building MarlinArbor
# @author Jan Engels, DESY
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2 FATAL_ERROR)
########################################################
# project name
PROJECT( MarlinArbor )
# project version
SET( MarlinArbor_VERSION_MAJOR 01 )
SET( MarlinArbor_VERSION_MINOR 04 )
SET( MarlinArbor_VERSION_PATCH 02 )
### CMAKE ###################################################################
# load default settings
INCLUDE( PandoraCMakeSettings )
### SOURCE ##################################################################
#include directories
INCLUDE_DIRECTORIES( ./include )
FILE(GLOB_RECURSE INPUT_DIR_INCS ./include/*.h)
SOURCE_GROUP("Header files" FILES ${INPUT_DIR_INCS} )
INSTALL( DIRECTORY ./include DESTINATION include FILES_MATCHING PATTERN "*.h" )
AUX_SOURCE_DIRECTORY( ./src/ MarlinArbor_SRCS )
IF( NOT CMAKE_CXX_FLAGS )
SET( CMAKE_CXX_FLAGS "-std=c++11" )
SET( PROCEED_WITHOUT_CXX_FLAGS ON )
ENDIF()
INCLUDE( CheckCXXCompilerFlag )
UNSET( COMPILER_SUPPORTS_CXX_FLAGS CACHE )
CHECK_CXX_COMPILER_FLAG( ${CMAKE_CXX_FLAGS} COMPILER_SUPPORTS_CXX_FLAGS )
IF( NOT COMPILER_SUPPORTS_CXX_FLAGS )
MESSAGE( STATUS "The compiler ${CMAKE_CXX_COMPILER} does not support cxx flags ${CMAKE_CXX_FLAGS}" )
IF( NOT PROCEED_WITHOUT_CXX_FLAGS )
MESSAGE( FATAL_ERROR "CMake abort." )
ENDIF()
MESSAGE( STATUS "Proceed without cxx flags ${CMAKE_CXX_FLAGS}" )
UNSET( CMAKE_CXX_FLAGS )
ENDIF()
if(APPLE)
SET( CMAKE_CXX_FLAGS "-Wall -Werror -pedantic -Wno-long-long -Wno-sign-compare -fno-strict-aliasing ${CMAKE_CXX_FLAGS}" )
else()
SET( CMAKE_CXX_FLAGS "-Wall -Werror -ansi -pedantic -Wno-long-long -Wno-sign-compare -fno-strict-aliasing ${CMAKE_CXX_FLAGS}" )
endif()
LIST( REMOVE_ITEM CMAKE_CXX_FLAGS -Weffc++ )
MESSAGE( STATUS "CMAKE_CXX_FLAGS : ${CMAKE_CXX_FLAGS}" )
### DEPENDENCIES ############################################################
FIND_PACKAGE( Marlin 1.0 REQUIRED )
FIND_PACKAGE( MarlinUtil REQUIRED )
FIND_PACKAGE( PandoraSDK 02.00.00 REQUIRED NO_CMAKE_PATH )
FIND_PACKAGE( ArborContent 01.01.00 REQUIRED )
FOREACH( pkg PandoraSDK ArborContent Marlin MarlinUtil )
IF( ${pkg}_FOUND )
INCLUDE_DIRECTORIES( ${${pkg}_INCLUDE_DIRS} )
LINK_LIBRARIES( ${${pkg}_LIBRARIES} )
ADD_DEFINITIONS ( ${${pkg}_DEFINITIONS} )
ENDIF()
ENDFOREACH()
IF( PANDORA_MONITORING )
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} )
FIND_PACKAGE( PandoraMonitoring 01.00.00 REQUIRED NO_CMAKE_PATH )
IF( PandoraMonitoring_FOUND )
INCLUDE_DIRECTORIES( ${PandoraMonitoring_INCLUDE_DIRS} )
LINK_LIBRARIES( ${PandoraMonitoring_LIBRARIES} )
ADD_DEFINITIONS ( ${PandoraMonitoring_DEFINITIONS} )
ADD_DEFINITIONS( "-DMONITORING" )
ENDIF()
ENDIF()
### 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_LIBRARY( MarlinArbor SHARED ${MarlinArbor_SRCS} ${INPUT_DIR_INCS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION} SOVERSION ${${PROJECT_NAME}_SOVERSION})
### INSTALL #################################################################
# install library
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT Runtime )
# install scripts files
INSTALL( DIRECTORY ./scripts DESTINATION scripts )
# display some variables and write them to cache
PANDORA_DISPLAY_STD_VARIABLES()