/
CMakeLists.txt
206 lines (181 loc) · 4.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2017-2021 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.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")
find_package(Jansson REQUIRED)
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
authenticate_console.cc
autoprune.cc
backup.cc
bsr.cc
catreq.cc
check_catalog.cc
consolidate.cc
dbcheck_utils.cc
dird_globals.cc
dir_plugins.cc
dird_conf.cc
expand.cc
fd_cmds.cc
get_database_connection.cc
getmsg.cc
inc_conf.cc
job.cc
jobq.cc
job_trigger.cc
migrate.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_slot2elemaddr.cc
ndmp_fhdb_mem.cc
ndmp_fhdb_lmdb.cc
ndmp_ndmmedia_db_helpers.cc
newvol.cc
next_vol.cc
quota.cc
run_hour_validator.cc
socket_server.cc
recycle.cc
restore.cc
run_conf.cc
run_on_incoming_connect_interval.cc
sd_cmds.cc
scheduler.cc
scheduler_job_item_queue.cc
scheduler_private.cc
stats.cc
storage.cc
ua.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
pthread_detach_if_not_detached.cc
)
if(HAVE_WIN32)
list(APPEND DIRD_OBJECTS_SRCS ../win32/dird/dirdres.rc)
endif()
if(HAVE_PAM)
include_directories(${PAM_INCLUDE_DIRS})
list(APPEND DIRD_OBJECTS_SRCS auth_pam.cc)
endif()
if(HAVE_WIN32)
include_directories(
${PROJECT_SOURCE_DIR}/src/win32/generic
${PROJECT_SOURCE_DIR}/src/win32/dird
)
endif()
set(DBCHKSRCS dbcheck.cc dbcheck_utils.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})
target_link_libraries(
dird_objects PRIVATE bareos ${OPENSSL_LIBRARIES} Threads::Threads
)
add_executable(bareos-dir)
target_sources(bareos-dir PRIVATE dird.cc)
target_link_libraries(
bareos-dir PRIVATE dird_objects bareoscats bareossql bareosfind
)
if(HAVE_WIN32)
target_sources(
bareos-dir PRIVATE ../win32/generic/main.cc ../win32/generic/service.cc
)
target_link_libraries(bareos-dir PRIVATE comctl32)
endif()
if(HAVE_NDMP)
target_link_libraries(dird_objects PRIVATE bareosndmp)
endif()
if(HAVE_LMDB)
target_link_libraries(dird_objects PRIVATE bareoslmdb)
endif()
if(HAVE_PAM)
target_link_libraries(dird_objects PRIVATE ${PAM_LIBRARIES})
endif()
add_subdirectory(dbcopy)
add_executable(bareos-dbcheck ${DBCHKSRCS})
target_link_libraries(
bareos-dbcheck PRIVATE bareossql bareos bareosfind bareoscats
${OPENSSL_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}")
message("using BACKENDS: ${BACKENDS}")
message("using PLUGINS: ${PLUGINS}")
install(CODE "set(BACKENDS \"${BACKENDS}\")")
install(CODE "set(PLUGINS \"${PLUGINS}\")")
install(CODE "set(configtemplatedir \"${configtemplatedir}\")")
install(CODE "set(SRC_DIR \"${PROJECT_SOURCE_DIR}\")")
install(SCRIPT ${PROJECT_SOURCE_DIR}/cmake/install-dird-configfiles.cmake)