/
CMakeLists.txt
114 lines (89 loc) · 3.79 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
# BAREOS�� - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2017-2017 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
# License as published by the Free Software Foundation and included
# in the file LICENSE.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
set(DIRDSRCS dird.cc)
#DIRD_OBJECTS_SRCS also used in a separate library for unittests
set(DIRD_OBJECTS_SRCS admin.cc archive.cc authenticate.cc autoprune.cc backup.cc bsr.cc catreq.cc
consolidate.cc dird_globals.cc dir_plugins.cc dird_conf.cc expand.cc fd_cmds.cc
getmsg.cc inc_conf.cc job.cc jobq.cc migrate.cc mountreq.cc msgchan.cc
ndmp_dma_storage.cc
ndmp_dma_backup_common.cc ndmp_dma_backup_NDMP_BAREOS.cc ndmp_dma_backup_NDMP_NATIVE.cc
ndmp_dma_generic.cc
ndmp_dma_restore_common.cc ndmp_dma_restore_NDMP_BAREOS.cc ndmp_dma_restore_NDMP_NATIVE.cc
ndmp_fhdb_common.cc ndmp_fhdb_helpers.cc
ndmp_fhdb_mem.cc ndmp_fhdb_lmdb.cc ndmp_ndmmedia_db_helpers.cc
newvol.cc next_vol.cc quota.cc socket_server.cc recycle.cc restore.cc
run_conf.cc sd_cmds.cc scheduler.cc stats.cc storage.cc ua_acl.cc ua_audit.cc
ua_cmds.cc ua_configure.cc ua_db.cc ua_dotcmds.cc ua_input.cc ua_impexp.cc
ua_label.cc ua_output.cc ua_prune.cc ua_purge.cc ua_query.cc ua_restore.cc
ua_run.cc ua_select.cc ua_server.cc ua_status.cc ua_tree.cc ua_update.cc
vbackup.cc verify.cc)
IF(HAVE_WIN32)
LIST(APPEND DIRD_OBJECTS_SRCS ../win32/dird/dirdres.rc)
ENDIF()
IF(HAVE_WIN32)
include_directories(${CMAKE_SOURCE_DIR}/src/win32/generic ${CMAKE_SOURCE_DIR}/src/win32/dird)
LIST(APPEND DIRDSRCS
../win32/generic/main.cc
../win32/generic/service.cc
)
ENDIF()
set(DBCHKSRCS dbcheck.cc dird_conf.cc dird_globals.cc ua_acl.cc ua_audit.cc run_conf.cc inc_conf.cc)
IF(HAVE_WIN32)
LIST(APPEND DBCHKSRCS ../win32/dird/dbcheckres.rc)
ENDIF()
set(TSTFNDSRCS testfind.cc dird_conf.cc dird_globals.cc ua_acl.cc ua_audit.cc run_conf.cc inc_conf.cc)
set(DIRD_RESTYPES catalog client console counter director fileset job jobdefs messages pool profile schedule storage)
#dird_objects is also used as library for unittests
add_library(dird_objects STATIC ${DIRD_OBJECTS_SRCS})
add_executable(bareos-dir ${DIRDSRCS})
set(BAREOS_DIR_LIBRARIES
dird_objects
bareos
bareoscats
bareossql
bareosfind
${LMDB_LIBS}
${NDMP_LIBS}
)
IF(HAVE_WIN32)
LIST(APPEND BAREOS_DIR_LIBRARIES
comctl32
)
ENDIF()
target_link_libraries(bareos-dir ${BAREOS_DIR_LIBRARIES})
add_executable(bareos-dbcheck ${DBCHKSRCS})
SET(DBCHECK_LIBRARIES bareossql bareos bareosfind bareoscats)
IF(HAVE_WIN32)
LIST(APPEND DBCHECK_LIBRARIES)
ENDIF()
target_link_libraries(bareos-dbcheck
${DBCHECK_LIBRARIES}
)
# is not built by default
#add_executable(testfind ${TSTFNDSRCS})
#target_link_libraries(testfind bareos bareosfind
# jansson ${OPENSSL_LIBS} acl cap lzo2
#)
INSTALL(TARGETS bareos-dir bareos-dbcheck DESTINATION "${sbindir}")
INSTALL(FILES query.sql DESTINATION "${scriptdir}")
install(CODE "set(PLUGINS \"${PLUGINS}\")")
install(CODE "set(BACKENDS \"${BACKENDS}\")")
install(CODE "set(configtemplatedir \"${configtemplatedir}\")")
install(CODE "set(SRC_DIR \"${PROJECT_SOURCE_DIR}\")")
install(SCRIPT ${CMAKE_SOURCE_DIR}/cmake/install-dird-configfiles.cmake)