CMakeLists.txt 13.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
#                      castor/CMakeLists.txt
#
# This file is part of the Castor project.
# See http://castor.web.cern.ch/castor
#
# Copyright (C) 2003  CERN
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
# Steven.Murray@cern.ch
#
cmake_minimum_required (VERSION 2.6)

25
26
27
if (${COMPILE_SERVER} STREQUAL "1")
  add_subdirectory (db)
  add_subdirectory (gc)
28
  add_subdirectory (messages)
29
30
  add_subdirectory (rh)
  add_subdirectory (job)
31
  add_subdirectory (legacymsg)
32
33
34
35
36
  add_subdirectory (scheduler)
  add_subdirectory (stager/daemon)
  add_subdirectory (tape)
  add_subdirectory (vdqm)
endif (${COMPILE_SERVER} STREQUAL "1")
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
################################################################################
# Rules to build and install libcastorclient.so
################################################################################
set (CLIENT_LIB_SRC_FILES
  BaseAddress.cpp
  VectorAddress.cpp
  BaseCnvSvc.cpp
  BaseObject.cpp
  BaseSvc.cpp
  Constants.cpp
  Converters.cpp
  Factories.cpp
  IObject.cpp
  IClient.cpp
  IClientFactory.cpp
  MessageAck.cpp
  ObjectCatalog.cpp
  ObjectSet.cpp
  Services.cpp
  System.cpp
  bwlist/Privilege.cpp
  bwlist/ChangePrivilege.cpp
  bwlist/ListPrivileges.cpp
  bwlist/ListPrivilegesResponse.cpp
  bwlist/BWUser.cpp
  bwlist/RequestType.cpp
  client/BaseClient.cpp
  client/BasicResponseHandler.cpp
  client/VectorResponseHandler.cpp
  dlf/Dlf.cpp
  dlf/IPAddress.cpp
  dlf/Message.cpp
  dlf/Param.cpp
  dlf/TimeStamp.cpp
  io/AbstractSocket.cpp
  io/AbstractTCPSocket.cpp
  io/AuthServerSocket.cpp
  io/AuthClientSocket.cpp
76
  io/IpAndPort.cpp
77
78
79
  io/UDPSocket.cpp
  io/PipeSocket.cpp
  io/ClientSocket.cpp
80
  io/io.cpp
81
82
  io/PollEventHandler.cpp
  io/PollReactor.cpp
83
  io/PollReactorImpl.cpp
David COME's avatar
David COME committed
84
  io/ZMQReactor.cpp
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
  io/ServerSocket.cpp
  io/StreamAddress.cpp
  io/StreamBaseCnv.cpp
  io/StreamBaseAddressCnv.cpp
  io/StreamClientCnv.cpp
  io/StreamStartResponseCnv.cpp
  io/StreamCnvSvc.cpp
  io/StreamDiskCopyForRecallCnv.cpp
  io/StreamDiskCopyInfoCnv.cpp
  io/StreamEndResponseCnv.cpp
  io/StreamFileResponseCnv.cpp
  io/StreamFiles2DeleteCnv.cpp
  io/StreamFilesDeletedCnv.cpp
  io/StreamNsFilesDeletedCnv.cpp
  io/StreamNsFilesDeletedResponseCnv.cpp
  io/StreamFilesDeletionFailedCnv.cpp
  io/StreamGetUpdateStartRequestCnv.cpp
  io/StreamGetUpdateStartResponseCnv.cpp
  io/StreamGCFilesResponseCnv.cpp
  io/StreamGCLocalFileCnv.cpp
  io/StreamGCFileCnv.cpp
  io/StreamGetUpdateDoneCnv.cpp
  io/StreamGetUpdateFailedCnv.cpp
  io/StreamMessageAckCnv.cpp
  io/StreamMoverCloseRequestCnv.cpp
  io/StreamPtrCnv.cpp
  io/StreamPutFailedCnv.cpp
  io/StreamPutStartRequestCnv.cpp
  io/StreamQueryParameterCnv.cpp
  io/StreamBasicResponseCnv.cpp
  io/StreamSetFileGCWeightCnv.cpp
  io/StreamStringResponseCnv.cpp
  io/StreamSubRequestCnv.cpp
  io/StreamStageAbortRequestCnv.cpp
  io/StreamStageFileQueryRequestCnv.cpp
  io/StreamStageGetRequestCnv.cpp
  io/StreamStagePrepareToGetRequestCnv.cpp
  io/StreamStagePrepareToPutRequestCnv.cpp
  io/StreamStagePutDoneRequestCnv.cpp
  io/StreamStagePutRequestCnv.cpp
  io/StreamStageRmRequestCnv.cpp
  io/StreamThreadNotificationCnv.cpp
  io/StreamStgFilesDeletedCnv.cpp
  io/StreamStgFilesDeletedResponseCnv.cpp
  io/StreamAbortResponseCnv.cpp
  io/StreamFileQryResponseCnv.cpp
  io/StreamFirstByteWrittenCnv.cpp
  io/StreamIOResponseCnv.cpp
  io/StreamDiskPoolQueryResponseCnv.cpp
  io/StreamFileSystemDescriptionCnv.cpp
  io/StreamDiskServerDescriptionCnv.cpp
  io/StreamDiskPoolQueryCnv.cpp
  io/StreamDiskPoolQueryCnvOld.cpp
  io/StreamVersionQueryCnv.cpp
  io/StreamVersionResponseCnv.cpp
  io/StreamPrivilegeCnv.cpp
  io/StreamListPrivilegesCnv.cpp
  io/StreamListPrivilegesResponseCnv.cpp
  io/StreamChangePrivilegeCnv.cpp
  io/StreamBWUserCnv.cpp
  io/StreamRequestTypeCnv.cpp
  io/StreamNsFileIdCnv.cpp
147
  log/Logger.cpp
148
  log/StringLogger.cpp
149
  log/SyslogLogger.cpp
Eric Cano's avatar
Eric Cano committed
150
  log/LogContext.cpp
151
152
  log/Message.cpp
  log/Param.cpp
153
154
155
156
157
158
159
160
161
162
163
164
165
  metrics/Counter.cpp
  metrics/InternalCounter.cpp
  metrics/Histogram.cpp
  metrics/MetricsCollector.cpp
  metrics/UpdateThread.cpp
  metrics/ObjTypeCounter.cpp
  query/DiskPoolQueryResponse.cpp
  query/FileSystemDescription.cpp
  query/DiskServerDescription.cpp
  query/DiskPoolQuery.cpp
  query/DiskPoolQueryType.cpp
  query/VersionQuery.cpp
  query/VersionResponse.cpp
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
  replier/ClientConnection.cpp
  replier/RequestReplier.cpp
  rh/Client.cpp
  rh/StartResponse.cpp
  rh/EndResponse.cpp
  rh/FileResponse.cpp
  rh/GetUpdateStartResponse.cpp
  rh/GCFilesResponse.cpp
  rh/Response.cpp
  rh/StringResponse.cpp
  rh/AbortResponse.cpp
  rh/FileQryResponse.cpp
  rh/IOResponse.cpp
  rh/BasicResponse.cpp
  server/AuthListenerThreadPool.cpp
  server/BaseThreadPool.cpp
182
  server/Daemon.cpp
183
184
  server/DynamicThreadPool.cpp
  server/ListenerThreadPool.cpp
185
  server/MultiThreadedDaemon.cpp
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
  server/TCPListenerThreadPool.cpp
  server/UDPListenerThreadPool.cpp
  server/ForkedProcessPool.cpp
  server/SignalThreadPool.cpp
  server/DbAlertedThreadPool.cpp
  server/Mutex.cpp
  server/NotifierThread.cpp
  server/SelectProcessThread.cpp
  server/ThreadNotification.cpp
  server/Queue.cpp
  stager/CastorFile.cpp
  stager/DiskCopyInfo.cpp
  stager/DiskCopyForRecall.cpp
  stager/DiskCopyStatusCodes.cpp
  stager/DiskFile.cpp
  stager/DiskServerStatusCode.cpp
  stager/FileSystemStatusCodes.cpp
  stager/DLFInit.cpp
  stager/FileClass.cpp
  stager/FileRequest.cpp
  stager/ErrorFileRequest.cpp
  stager/Files2Delete.cpp
  stager/FilesDeleted.cpp
  stager/NsFilesDeleted.cpp
  stager/NsFilesDeletedResponse.cpp
  stager/StgFilesDeleted.cpp
  stager/StgFilesDeletedResponse.cpp
  stager/FilesDeletionFailed.cpp
  stager/FirstByteWritten.cpp
  stager/GetUpdateDone.cpp
  stager/GetUpdateFailed.cpp
  stager/GetUpdateStartRequest.cpp
  stager/GCLocalFile.cpp
  stager/GCFile.cpp
  stager/GCFileList.cpp
  stager/MoverCloseRequest.cpp
  stager/PutStartRequest.cpp
  stager/QryRequest.cpp
  stager/PutFailed.cpp
  stager/Request.cpp
  stager/RequestQueryType.cpp
  stager/RemoteGCSvc.cpp
  stager/RemoteJobSvc.cpp
  stager/IJobSvcCInt.cpp
  stager/StartRequest.cpp
  stager/SvcClass.cpp
  stager/QueryParameter.cpp
  stager/SetFileGCWeight.cpp
  stager/StageAbortRequest.cpp
  stager/StageFileQueryRequest.cpp
  stager/StageGetRequest.cpp
  stager/StagePrepareToGetRequest.cpp
  stager/StagePrepareToPutRequest.cpp
  stager/StagePutDoneRequest.cpp
  stager/StagePutRequest.cpp
  stager/StageQueryResult.cpp
  stager/StageRmRequest.cpp
  stager/SubRequest.cpp
  stager/SubRequestStatusCodes.cpp
  stager/SubRequestGetNextStatusCodes.cpp
  stager/TapeVid.cpp
  stager/NsFileId.cpp
  stager/BulkRequestResult.cpp
  stager/FileResult.cpp
250
  utils/DebugBuf.cpp
Steven Murray's avatar
Steven Murray committed
251
  utils/SmartFd.cpp
252
  utils/SmartFILEPtr.cpp
253
  utils/utils.cpp
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
  vdqm/ClientIdentification.cpp
  vdqm/TapeDrive.cpp
  vdqm/DeviceGroupName.cpp
  vdqm/TapeAccessSpecification.cpp
  vdqm/TapeDriveCompatibility.cpp
  vdqm/TapeDriveDedication.cpp
  vdqm/TapeDriveStatusCodes.cpp
  vdqm/TapeRequest.cpp
  vdqm/TapeRequestStatusCodes.cpp
  vdqm/TapeServer.cpp
  vdqm/TapeServerStatusCodes.cpp
  vdqm/VdqmTape.cpp
  ../client/src/stager/stager_client_api_common.cpp
  ../client/src/stager/stager_client_commandline.cpp
  ../client/src/stager/stager_client_changePrivilege.c
  ../client/src/stager/stager_client_api_get.cpp
  ../client/src/stager/stager_client_api_put.cpp
  ../client/src/stager/stager_client_api_open.cpp
  ../client/src/stager/stager_client_api_query.cpp
  ../client/src/stager/stager_client_api_rm.cpp
  ../client/src/stager/stager_client_api_setFileGCWeight.cpp
  ../client/src/stager/stager_client_api_version.cpp
  ../client/src/stager/stager_client_api_changePrivilege.cpp
  ../client/src/stager/stager_client_api_listPrivileges.cpp
  ../client/src/stager/stager_errmsg.c
  ../client/src/stager/stager_mapper.c)
add_library (castorclient SHARED ${CLIENT_LIB_SRC_FILES})
281
282
283
# Relax compilation of old code full of pointer casting. Funnily enough,
# the compiler only complains in -O2 mode (RelWithDebInfo in cmake).
set_property(SOURCE ../client/src/stager/stager_errmsg.c APPEND PROPERTY COMPILE_FLAGS -fno-strict-aliasing)
284
CastorSetLibraryVersions (castorclient)
David COME's avatar
David COME committed
285
target_link_libraries (castorclient castordlf zmq)
286
install (TARGETS castorclient DESTINATION ${CASTOR_DEST_LIB_DIR})
287

288
289
290
291
if (${COMPILE_SERVER} STREQUAL "1")
  CastorInstallExample (castor.conf /etc/castor)
  CastorInstallExample (rsyslog.conf.client /etc/castor)
  CastorInstallExample (rsyslog.conf.server /etc/castor)
292

293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
  ################################################################################
  # Installation of header files for package castor-build-headers
  ################################################################################
  
  # Required by xrootd-xcastor2fs and castor-srmv2
  install(FILES
    BaseObject.hpp
    Constants.hpp
    IObject.hpp
    IService.hpp
    Services.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    client/BaseClient.hpp
    client/IResponseHandler.hpp
    client/VectorResponseHandler.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/client
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    dlf/Dlf.hpp
    dlf/IPAddress.hpp
    dlf/Message.hpp
    dlf/Param.hpp
    dlf/TimeStamp.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/dlf
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
324
    exception/AcceptConnectionInterrupted.hpp
325
    exception/AlreadyInitialized.hpp
326
    exception/Backtrace.hpp
327
    exception/BadAlloc.hpp
328
    exception/BadMessage.hpp
329
    exception/CommandLineNotParsed.hpp
330
331
    exception/Communication.hpp
    exception/Exception.hpp
332
    exception/InvalidArgument.hpp
333
    exception/InvalidNbArguments.hpp
334
    exception/NoEntry.hpp
335
    exception/NotAnOwner.hpp
336
337
    exception/OutOfMemory.hpp
    exception/SQLError.hpp
338
339
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/exception
    PERMISSIONS ${CASTOR_HEADER_PERMS})
340

341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
  install(FILES
    io/ServerSocket.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/io
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    rh/Client.hpp
    rh/FileResponse.hpp
    rh/IOResponse.hpp
    rh/Response.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/rh
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    stager/DiskCopyStatusCodes.hpp
    stager/FileRequest.hpp
    stager/ICommonSvc.hpp
    stager/Request.hpp
    stager/StageGetRequest.hpp
    stager/StagePrepareToGetRequest.hpp
    stager/StagePrepareToPutRequest.hpp
    stager/StagePutRequest.hpp
    stager/SubRequestGetNextStatusCodes.hpp
    stager/SubRequest.hpp
    stager/SubRequestStatusCodes.hpp
    stager/TapeVid.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/stager
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  # Required by xrootd-xcastor2fs
  install(FILES  io/AbstractSocket.hpp
    io/AbstractTCPSocket.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/io
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    stager/IJobSvc.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/stager
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  # Required by castor-srmv2
  install(FILES
    BaseAddress.hpp
    BaseCnvSvc.hpp
    BaseSvc.hpp
    CnvFactory.hpp
    Converters.hpp
    Factories.hpp
    IAddress.hpp
    IClient.hpp
    ICnvFactory.hpp
    ICnvSvc.hpp
    IConverter.hpp
    IFactory.hpp
    ISvcFactory.hpp
    MessageAck.hpp
    ObjectSet.hpp
    SvcFactory.hpp
    System.hpp
    VectorAddress.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    db/DbBaseObj.hpp
    db/DbCnvSvc.hpp
    db/DbParamsSvc.hpp
    db/IDbResultSet.hpp
    db/IDbStatement.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/db
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    db/cnv/DbBaseCnv.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/db/cnv
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    db/ora/OraCnvSvc.hpp
    db/ora/OraCommonSvc.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/db/ora
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    io/ClientSocket.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/io
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    metrics/Counter.hpp
    metrics/Histogram.hpp
    metrics/MetricsCollector.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/metrics
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    query/DiskPoolQueryType.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/query
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    rh/FileQryResponse.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/rh
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    server/BaseThreadPool.hpp
    server/DynamicThreadPool.hpp
    server/IThread.hpp
    server/ListenerThreadPool.hpp
    server/Mutex.hpp
    server/NotifierThread.hpp
    server/Queue.hpp
    server/SelectProcessThread.hpp
    server/SignalThreadPool.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/server
    PERMISSIONS ${CASTOR_HEADER_PERMS})
  
  install(FILES
    stager/NsFileId.hpp
    stager/QryRequest.hpp
    stager/QueryParameter.hpp
    stager/RequestQueryType.hpp
    stager/StageAbortRequest.hpp
    stager/StageFileQueryRequest.hpp
    stager/StageRmRequest.hpp
    stager/SvcClass.hpp
    DESTINATION ${CASTOR_DEST_CPP_HEADERS_DIR}/stager
    PERMISSIONS ${CASTOR_HEADER_PERMS})
endif (${COMPILE_SERVER} STREQUAL "1")