-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
103 lines (65 loc) · 2.93 KB
/
CMakeLists.txt
File metadata and controls
103 lines (65 loc) · 2.93 KB
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
########################################################
# cmake file for building RAIDA
# @author Jan Engels, Desy IT
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
########################################################
# project name
PROJECT( RAIDA )
# project version
SET( ${PROJECT_NAME}_VERSION_MAJOR 1 )
SET( ${PROJECT_NAME}_VERSION_MINOR 12 )
SET( ${PROJECT_NAME}_VERSION_PATCH 0 )
cmake_policy(SET CMP0008 NEW)
### DEPENDENCIES ############################################################
FIND_PACKAGE( ILCUTIL REQUIRED COMPONENTS ILCSOFT_CMAKE_MODULES )
# load default settings from ILCSOFT_CMAKE_MODULES
INCLUDE( ilcsoft_default_settings )
# at least version 5.0 of ROOT is required
FIND_PACKAGE( ROOT 5.0 REQUIRED )
### DOCUMENTATION ###########################################################
OPTION( INSTALL_DOC "Set to OFF to skip build/install Documentation" OFF )
IF( INSTALL_DOC )
FIND_PACKAGE( Doxygen )
IF( DOXYGEN_EXECUTABLE )
ADD_SUBDIRECTORY( ./doc )
ELSE()
MESSAGE( SEND_ERROR "Could not find doxygen required to build documentation" )
MESSAGE( "Please install doxygen or set INSTALL_DOC to OFF" )
MESSAGE( "" )
ENDIF()
ENDIF()
#############################################################################
INCLUDE_DIRECTORIES( BEFORE ./include )
INSTALL_DIRECTORY( ./include DESTINATION . FILES_MATCHING PATTERN "*.h" )
#FIXME: silence the eccessive warnings for now
# should be addressed later - if needed
ADD_DEFINITIONS( "-Wno-effc++ -Wno-unused-parameter -Wno-vla" )
# verbose debug mode
OPTION( RAIDA_DEBUG_VERBOSE_FACTORY "Set to ON to additional verbosity" OFF )
MESSAGE( STATUS "RAIDA_DEBUG_VERBOSE_FACTORY: ${RAIDA_DEBUG_VERBOSE_FACTORY}" )
IF( RAIDA_DEBUG_VERBOSE_FACTORY )
ADD_DEFINITIONS( "-DUSE_RAIDA_DEBUG_VERBOSE_FACTORY" )
ENDIF()
# RAIDA library
AUX_SOURCE_DIRECTORY( ./src library_sources )
ADD_SHARED_LIBRARY( RAIDA ${library_sources} )
INSTALL_SHARED_LIBRARY( RAIDA DESTINATION lib )
TARGET_LINK_LIBRARIES( RAIDA ROOT::Tree ROOT::Graf)
# RAIDA example
IF( BUILD_TESTING )
ADD_EXECUTABLE( RAIDA_EXAMPLE ./example/example.cc )
TARGET_LINK_LIBRARIES( RAIDA_EXAMPLE RAIDA )
#INSTALL( TARGETS RAIDA_EXAMPLE DESTINATION bin )
ENDIF()
# install aida configuration scripts
INSTALL( PROGRAMS "./bin/aida-config" "./bin/aida-setup.sh" DESTINATION bin )
# display some variables and write them to cache
DISPLAY_STD_VARIABLES()
# generate and install following configuration files
GENERATE_PACKAGE_CONFIGURATION_FILES( RAIDAConfig.cmake RAIDAConfigVersion.cmake AIDAConfig.cmake AIDAConfigVersion.cmake RAIDALibDeps.cmake )
# Make a symbolic link in lib/cmake from RAIDA to AIDA to make sure that find_package(AIDA) works
install(CODE "
if(EXISTS \"${CMAKE_INSTALL_PREFIX}/lib/cmake/RAIDA\")
execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink \"${CMAKE_INSTALL_PREFIX}/lib/cmake/RAIDA\" \"${CMAKE_INSTALL_PREFIX}/lib/cmake/AIDA\")
endif()
")