-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
82 lines (51 loc) · 2.24 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
######################################################
# cmake file for building LCCD
# @author Jan Engels, DESY
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 FATAL_ERROR )
######################################################
# project name
PROJECT( LCCD )
# project version
SET( LCCD_VERSION_MAJOR 1 )
SET( LCCD_VERSION_MINOR 5 )
SET( LCCD_VERSION_PATCH 2 )
### DEPENDENCIES ############################################################
FIND_PACKAGE( ILCUTIL REQUIRED COMPONENTS ILCSOFT_CMAKE_MODULES ILCTEST )
# load default settings from ILCSOFT_CMAKE_MODULES
INCLUDE( ilcsoft_default_settings )
FIND_PACKAGE( LCIO 2.20.1 REQUIRED )
# export following variables to LCCDConfig.cmake
SET( LCCD_DEPENDS_INCLUDE_DIRS ${LCIO_INCLUDE_DIRS} )
SET( LCCD_DEPENDS_LIBRARY_DIRS ${LCIO_LIBRARY_DIRS} )
SET( LCCD_DEPENDS_LIBRARIES ${LCIO_LIBRARIES} )
# CondDBMySQL
OPTION( LCCD_CONDDBMYSQL "Set to ON to build with CondDBMySQL" ON )
IF( LCCD_CONDDBMYSQL )
FIND_PACKAGE( CondDBMySQL REQUIRED )
ENDIF()
### 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()
### LIBRARY AND TOOLS #######################################################
# -------- generate LCCDConfig.h --------------------------------------------
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/cmake/LCCDConfig.h.cmake.in"
"${PROJECT_BINARY_DIR}/lccd/LCCDConfig.h" @ONLY )
INSTALL( FILES "${PROJECT_BINARY_DIR}/lccd/LCCDConfig.h" DESTINATION "include/lccd/" )
# ---------------------------------------------------------------------------
ADD_SUBDIRECTORY( ./source )
# display some variables and write them to cache
DISPLAY_STD_VARIABLES()
MESSAGE( STATUS "LCCD_CONDDBMYSQL = ${LCCD_CONDDBMYSQL}" )
MESSAGE( STATUS "LCCD_DB_INIT = ${LCCD_DB_INIT}" )
MESSAGE( STATUS )
# generate and install following configuration files
GENERATE_PACKAGE_CONFIGURATION_FILES( LCCDConfig.cmake LCCDConfigVersion.cmake)