-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
845 lines (759 loc) · 23.4 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
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
250
251
252
253
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
281
282
283
284
285
286
287
288
289
290
291
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
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
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
include(GetGitRevisionDescription)
enable_language(C ASM)
set(bindir ${CMAKE_INSTALL_PREFIX}/bin)
set(sbindir ${CMAKE_INSTALL_PREFIX}/sbin)
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
set(sysconfdir ${CMAKE_INSTALL_PREFIX}/etc)
set(pkgdatadir ${CMAKE_INSTALL_PREFIX}/share)
set(prefix ${CMAKE_INSTALL_PREFIX})
add_definitions("-DCEPH_LIBDIR=\"${libdir}\"")
add_definitions("-DCEPH_PKGLIBDIR=\"${libdir}\"")
add_definitions("-DHAVE_CONFIG_H -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_GNU_SOURCE")
set(CMAKE_ASM_COMPILER ${PROJECT_SOURCE_DIR}/src/yasm-wrapper)
message(status " ams compiler ${CMAKE_ASM_COMPILER}")
set(CMAKE_ASM_FLAGS "-f elf64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic -Wall -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -ftemplate-depth-1024 -Wno-invalid-offsetof -Wnon-virtual-dtor -Wno-invalid-offsetof -Wstrict-null-sentinel -Woverloaded-virtual")
set(EXTRALIBS uuid rt dl ${Boost_LIBS})
if(${WITH_PROFILER})
list(APPEND EXTRALIBS profiler)
endif(${WITH_PROFILER})
if(WITH_CDS)
list(APPEND EXTRALIBS ${CDS_LIBS})
endif(WITH_CDS)
if(USE_NSS)
if(NSS_FOUND)
if(NSPR_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${NSS_INCLUDE_DIR} -I${NSPR_INCLUDE_DIR}")
endif(NSPR_FOUND)
endif(NSS_FOUND)
endif(USE_NSS)
if(${HAVE_ATOMIC_OPS})
set(EXTRALIBS
atomic_ops
${EXTRALIBS})
endif(${HAVE_ATOMIC_OPS})
set(GCOV_PREFIX_STRIP 4)
get_git_head_revision(GIT_REFSPEC CEPH_GIT_VER)
git_describe(CEPH_GIT_NICE_VER --always)
# Python stuff
find_package(PythonInterp 2 QUIET)
if(NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR "Python 2 interpreter not found.")
endif(NOT PYTHONINTERP_FOUND)
# if CMAKE_INSTALL_PREFIX is an empty string, must replace
# it with "/" to make PYTHON_INSTALL_TEMPLATE an absolute path to be
# consistent with all other installation paths.
if(CMAKE_INSTALL_PREFIX)
set(PYTHON_INSTALL_TEMPLATE "${CMAKE_INSTALL_PREFIX}")
else(CMAKE_INSTALL_PREFIX)
set(PYTHON_INSTALL_TEMPLATE "/")
endif(CMAKE_INSTALL_PREFIX)
execute_process(
COMMAND
${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='${PYTHON_INSTALL_TEMPLATE}')"
OUTPUT_VARIABLE PYTHON_INSTDIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(HAVE_XIO)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${Xio_INCLUDE_DIR}")
list(APPEND EXTRALIBS ${Xio_LIBRARY} ibverbs rdmacm pthread rt)
endif(HAVE_XIO)
if(${WITH_TCMALLOC})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
set(TCMALLOC_LIBS tcmalloc)
set(TCMALLOC_srcs perfglue/heap_profiler.cc)
else()
set(TCMALLOC_srcs perfglue/disabled_heap_profiler.cc)
endif(${WITH_TCMALLOC})
# tcmalloc heap profiler
set(heap_profiler_files ${TCMALLOC_srcs})
add_library(heap_profiler_objs OBJECT ${heap_profiler_files})
set(LIBEDIT_LIBS edit)
# Common infrastructure
configure_file(
${CMAKE_SOURCE_DIR}/src/ceph_ver.h.in.cmake
${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
@ONLY)
set(arch_files
arch/arm.c
arch/intel.c
arch/probe.cc)
set(auth_files
auth/AuthAuthorizeHandler.cc
auth/AuthClientHandler.cc
auth/AuthSessionHandler.cc
auth/AuthMethodList.cc
auth/cephx/CephxAuthorizeHandler.cc
auth/cephx/CephxClientHandler.cc
auth/cephx/CephxProtocol.cc
auth/cephx/CephxSessionHandler.cc
auth/none/AuthNoneAuthorizeHandler.cc
auth/unknown/AuthUnknownAuthorizeHandler.cc
auth/Crypto.cc
auth/KeyRing.cc
auth/RotatingKeyRing.cc)
set(mds_files)
list(APPEND mds_files
mds/MDSMap.cc
mds/inode_backtrace.cc
mds/mdstypes.cc)
set(crush_srcs
crush/builder.c
crush/mapper.c
crush/crush.c
crush/hash.c
crush/CrushWrapper.cc
crush/CrushCompiler.cc
crush/CrushTester.cc)
add_subdirectory(json_spirit)
set(xio_common_srcs)
if(HAVE_XIO)
list(APPEND xio_common_srcs
msg/xio/XioConnection.cc
msg/xio/XioMsg.cc
msg/xio/XioPool.cc
msg/xio/XioMessenger.cc
msg/xio/XioPortal.cc
msg/xio/QueueStrategy.cc)
endif(HAVE_XIO)
set(libcommon_files
${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
ceph_ver.c
common/DecayCounter.cc
common/LogClient.cc
common/LogEntry.cc
common/PrebufferedStreambuf.cc
common/BackTrace.cc
common/perf_counters.cc
common/Mutex.cc
common/OutputDataSocket.cc
common/admin_socket.cc
common/admin_socket_client.cc
common/bloom_filter.cc
common/Readahead.cc
${crush_srcs}
common/cmdparse.cc
common/escape.c
common/io_priority.cc
common/Clock.cc
common/Throttle.cc
common/Timer.cc
common/Finisher.cc
common/environment.cc
common/sctp_crc32.c
common/crc32c.cc
common/crc32c_intel_baseline.c
common/crc32c_intel_fast.c
common/crc32c_intel_fast_asm.S
common/crc32c_intel_fast_zero_asm.S
common/assert.cc
common/run_cmd.cc
common/WorkQueue.cc
common/ConfUtils.cc
common/MemoryModel.cc
common/fd.cc
common/xattr.c
common/str_list.cc
common/str_map.cc
common/snap_types.cc
common/errno.cc
common/TrackedOp.cc
common/SloppyCRCMap.cc
common/types.cc
common/TextTable.cc
log/Log.cc
log/SubsystemMap.cc
mon/MonCap.cc
mon/MonClient.cc
mon/MonMap.cc
msg/simple/Accepter.cc
msg/simple/DispatchQueue.cc
msg/Message.cc
osd/ECMsgTypes.cc
osd/HitSet.cc
common/RefCountedObj.cc
msg/Messenger.cc
msg/simple/Pipe.cc
msg/simple/PipeConnection.cc
msg/simple/SimpleMessenger.cc
msg/async/AsyncConnection.cc
msg/async/AsyncMessenger.cc
msg/async/Event.cc
msg/async/EventEpoll.cc
msg/async/EventSelect.cc
msg/async/net_handler.cc
${xio_common_srcs}
msg/msg_types.cc
common/hobject.cc
osd/OSDMap.cc
common/histogram.cc
osd/osd_types.cc
common/blkdev.cc
common/common_init.cc
common/pipe.c
common/ceph_argparse.cc
common/ceph_context.cc
common/buffer.cc
common/code_environment.cc
common/dout.cc
common/signal.cc
common/simple_spin.cc
common/Thread.cc
common/Formatter.cc
common/HeartbeatMap.cc
common/ceph_fs.cc
common/ceph_hash.cc
common/ceph_strings.cc
common/ceph_frag.cc
common/config.cc
common/utf8.c
common/mime.c
common/strtol.cc
common/page.cc
common/lockdep.cc
common/version.cc
common/hex.cc
common/entity_name.cc
common/ceph_crypto.cc
common/ceph_crypto_cms.cc
common/ceph_json.cc
common/ipaddr.cc
common/pick_address.cc
common/address_helper.cc
common/linux_version.c
osdc/Striper.cc
osdc/Objecter.cc
${arch_files}
${auth_files}
${mds_files})
set(mon_common_files
auth/AuthSessionHandler.cc
auth/cephx/CephxSessionHandler.cc
erasure-code/ErasureCodePlugin.cc)
add_library(mon_common_objs OBJECT ${mon_common_files})
set(common_mountcephfs_files
common/armor.c
common/safe_io.c
common/module.c
common/addr_parsing.c)
add_library(common_mountcephfs_objs OBJECT
${common_mountcephfs_files})
if(${WITH_PROFILER})
list(APPEND libcommon_files
perfglue/cpu_profiler.cc)
else()
list(APPEND libcommon_files
perfglue/disabled_stubs.cc)
endif(${WITH_PROFILER})
if(${ENABLE_SHARED})
list(APPEND libcommon_files
$<TARGET_OBJECTS:global_common_objs>)
endif(${ENABLE_SHARED})
add_library(common STATIC ${libcommon_files}
$<TARGET_OBJECTS:mon_common_objs>
$<TARGET_OBJECTS:common_mountcephfs_objs>)
set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ceph_ver.c
${CMAKE_SOURCE_DIR}/src/common/version.cc
${CMAKE_SOURCE_DIR}/src/test/encoding/ceph_dencoder.cc
APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h)
if(${WITH_PROFILER})
target_link_libraries(common profiler)
endif(${WITH_PROFILER})
add_library(common_utf8 STATIC common/utf8.c)
target_link_libraries( common json_spirit common_utf8 erasure_code rt uuid ${CRYPTO_LIBS} ${Boost_LIBRARIES})
set(libglobal_srcs
global/global_init.cc
global/pidfile.cc
global/signal_handler.cc)
set(global_common_files
global/global_context.cc)
add_library(global_common_objs OBJECT ${global_common_files})
add_library(global STATIC ${libglobal_srcs}
$<TARGET_OBJECTS:global_common_objs>)
target_link_libraries(global common ${CMAKE_THREAD_LIBS_INIT} ${CRYPTO_LIBS}
${EXTRALIBS})
if(${ENABLE_SHARED})
set_target_properties(global PROPERTIES
OUTPUT_NAME ceph-global VERSION "1.0.0" SOVERSION "1")
endif(${ENABLE_SHARED})
# rados object classes
add_subdirectory(cls)
# RADOS client/library
set(osdc_files
osdc/Objecter.cc
osdc/Filer.cc)
set(osdc_rbd_files
osdc/ObjectCacher.cc
osdc/Striper.cc)
add_library(osdc_rbd_objs OBJECT ${osdc_rbd_files})
add_library(osdc STATIC ${osdc_files} $<TARGET_OBJECTS:osdc_rbd_objs>)
set(librados_srcs
librados/librados.cc
librados/RadosClient.cc
librados/IoCtxImpl.cc
librados/snap_set_diff.cc
librados/RadosXattrIter.cc
)
add_library(librados ${CEPH_SHARED} ${librados_srcs}
$<TARGET_OBJECTS:cls_references_objs>
$<TARGET_OBJECTS:heap_profiler_objs>
$<TARGET_OBJECTS:common_util_obj>)
add_dependencies(librados osdc)
target_link_libraries(librados PRIVATE osdc osd os global common cls_lock_client
${BLKID_LIBRARIES}
${CRYPTO_LIBS} ${EXTRALIBS} ${TCMALLOC_LIBS})
if(${ENABLE_SHARED})
set_target_properties(librados PROPERTIES OUTPUT_NAME rados VERSION 2.0.0
SOVERSION 2)
endif(${ENABLE_SHARED})
install(FILES include/rados/librados.h
include/rados/rados_types.h
include/rados/rados_types.hpp
include/rados/librados.hpp
include/buffer.h
include/page.h
include/crc32c.h
DESTINATION include/rados)
install(TARGETS librados DESTINATION lib)
set(libradosstriper_srcs
libradosstriper/libradosstriper.cc
libradosstriper/RadosStriperImpl.cc
libradosstriper/MultiAioCompletionImpl.cc)
add_library(libradosstriper ${libradosstriper_srcs})
target_link_libraries(libradosstriper librados cls_lock_client)
set(rados_srcs
tools/rados/rados.cc
tools/RadosDump.cc
tools/rados/RadosImport.cc
tools/rados/PoolDump.cc
common/obj_bencher.cc)
add_executable(rados ${rados_srcs} $<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} libradosstriper)
if (WITH_CEPHFS)
set(cephfs_journal_tool_srcs
tools/cephfs/cephfs-journal-tool.cc
tools/cephfs/JournalTool.cc
tools/cephfs/JournalFilter.cc
tools/cephfs/JournalScanner.cc
tools/cephfs/EventOutput.cc
tools/cephfs/Dumper.cc
tools/cephfs/Resetter.cc
tools/cephfs/MDSUtility.cc)
add_executable(cephfs-journal-tool ${cephfs_journal_tool_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(cephfs-journal-tool librados mds osdc global
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
set(cephfs_table_tool_srcs
tools/cephfs/cephfs-table-tool.cc
tools/cephfs/TableTool.cc
tools/cephfs/MDSUtility.cc)
add_executable(cephfs-table-tool ${cephfs_table_tool_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(cephfs-table-tool librados mds osdc global
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
set(cephfs_data_scan_srcs
tools/cephfs/cephfs-data-scan.cc
tools/cephfs/DataScan.cc
tools/cephfs/MDSUtility.cc)
add_executable(cephfs-data-scan ${cephfs_data_scan_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(cephfs-data-scan librados mds osdc global
cls_cephfs_client
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
endif (WITH_CEPHFS)
set(librados_config_srcs
librados-config.cc)
add_executable(librados-config ${librados_config_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(librados-config librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}
${TCMALLOC_LIBS})
install(TARGETS rados librados-config DESTINATION bin)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/
DESTINATION ${PYTHON_INSTDIR})
# Monitor
set(lib_mon_srcs
auth/cephx/CephxKeyServer.cc
auth/cephx/CephxServiceHandler.cc
auth/AuthServiceHandler.cc
${osd_mon_files} mon/Paxos.cc
mon/PaxosService.cc
mon/OSDMonitor.cc
mon/MDSMonitor.cc
mon/MonmapMonitor.cc
mon/LogMonitor.cc
mon/AuthMonitor.cc
mon/Elector.cc
mon/HealthMonitor.cc
${os_mon_files}
mon/DataHealthService.cc
mon/PGMonitor.cc
mon/PGMap.cc
mon/ConfigKeyService.cc)
set(common_util_src
common/util.cc)
add_library(common_util_obj OBJECT ${common_util_src})
add_library(mon STATIC ${lib_mon_srcs} $<TARGET_OBJECTS:mon_common_objs>
$<TARGET_OBJECTS:os_mon_objs> $<TARGET_OBJECTS:osd_mon_objs>
$<TARGET_OBJECTS:common_util_obj>)
set(ceph_mon_srcs
ceph_mon.cc
common/TextTable.cc)
add_executable(ceph-mon ${ceph_mon_srcs} $<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(ceph-mon mon boost_thread common os global ${EXTRALIBS}
${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
install(TARGETS ceph-mon DESTINATION bin)
# OSD
set(libos_srcs
os/FileJournal.cc
os/FileStore.cc
os/chain_xattr.cc
os/ObjectStore.cc
os/JournalingObjectStore.cc
os/LFNIndex.cc
os/IndexManager.cc
os/FlatIndex.cc
os/LevelDBStore.cc
os/DBObjectMap.cc
os/Transaction.cc
os/WBThrottle.cc
os/GenericFileStoreBackend.cc
os/BtrfsFileStoreBackend.cc
os/ZFSFileStoreBackend.cc
os/XfsFileStoreBackend.cc
os/KeyValueStore.cc
os/KeyValueDB.cc
os/MemStore.cc
os/GenericObjectMap.cc
os/HashIndex.cc)
set(os_mon_files
os/LevelDBStore.cc)
add_library(os_mon_objs OBJECT ${os_mon_files})
add_library(os STATIC ${libos_srcs} $<TARGET_OBJECTS:os_mon_objs>)
if(${HAVE_LIBAIO})
target_link_libraries(os aio)
endif(${HAVE_LIBAIO})
target_link_libraries(os leveldb snappy)
set(cls_references_files objclass/class_api.cc)
add_library(cls_references_objs OBJECT ${cls_references_files})
set(osdc_osd_srcs
osdc/Objecter.cc
osdc/Striper.cc)
set(osd_srcs
osd/OSD.cc
osd/Watch.cc
osd/ClassHandler.cc
osd/OpRequest.cc
osd/PG.cc
osd/PGLog.cc
osd/ReplicatedPG.cc
osd/ReplicatedBackend.cc
osd/ECBackend.cc
osd/ECTransaction.cc
osd/PGBackend.cc
osd/OSD.cc
osd/OSDCap.cc
osd/Watch.cc
osd/ClassHandler.cc
osd/OpRequest.cc
common/TrackedOp.cc
osd/SnapMapper.cc
osd/osd_types.cc
osd/ECUtil.cc
objclass/class_api.cc
${osdc_osd_srcs})
set(osd_mon_files
mon/Monitor.cc)
add_library(osd_mon_objs OBJECT ${osd_mon_files})
add_library(osd STATIC ${osd_srcs} $<TARGET_OBJECTS:osd_mon_objs>
$<TARGET_OBJECTS:cls_references_objs>)
target_link_libraries(osd dl leveldb)
set(ceph_osd_srcs
ceph_osd.cc
objclass/class_api.cc)
add_executable(ceph-osd ${ceph_osd_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>
$<TARGET_OBJECTS:common_util_obj>)
target_link_libraries(ceph-osd osd os global ${BLKID_LIBRARIES} ${TCMALLOC_LIBS})
install(TARGETS ceph-osd DESTINATION bin)
# MDS
if(${WITH_MDS})
set(mds_srcs
mds/Capability.cc
mds/MDS.cc
mds/Beacon.cc
mds/flock.cc
mds/locks.c
mds/journal.cc
mds/Server.cc
mds/Mutation.cc
mds/MDCache.cc
mds/RecoveryQueue.cc
mds/Locker.cc
mds/Migrator.cc
mds/MDBalancer.cc
mds/CDentry.cc
mds/CDir.cc
mds/CInode.cc
mds/LogEvent.cc
mds/MDSTable.cc
mds/InoTable.cc
mds/MDSTableClient.cc
mds/MDSTableServer.cc
mds/SnapRealm.cc
mds/SnapServer.cc
mds/snap.cc
mds/SessionMap.cc
mds/MDSContext.cc
mds/MDSAuthCaps.cc
mds/MDLog.cc
mds/JournalPointer.cc
mds/StrayManager.cc
mds/SimpleLock.cc
${CMAKE_SOURCE_DIR}/src/osdc/Journaler.cc)
add_library(mds ${mds_srcs})
set(ceph_mds_srcs
ceph_mds.cc)
add_executable(ceph-mds ${ceph_mds_srcs}
$<TARGET_OBJECTS:heap_profiler_objs>
$<TARGET_OBJECTS:common_util_obj>)
target_link_libraries(ceph-mds mds osdc ${CMAKE_DL_LIBS} global
${TCMALLOC_LIBS} boost_thread)
install(TARGETS ceph-mds DESTINATION bin)
endif(${WITH_MDS})
add_subdirectory(erasure-code)
set(crushtool_srcs
tools/crushtool.cc)
add_executable(crushtool ${crushtool_srcs})
target_link_libraries(crushtool global)
# Support/Tools
add_subdirectory(gmock)
add_subdirectory(test)
set(cephfs_srcs cephfs.cc)
add_executable(cephfstool ${cephfs_srcs})
target_link_libraries(cephfstool common ${EXTRALIBS})
set_target_properties(cephfstool PROPERTIES OUTPUT_NAME cephfs)
install(TARGETS cephfstool DESTINATION bin)
#set(ceph_srcs tools/ceph.cc tools/common.cc)
#add_executable(ceph ${ceph_srcs})
#target_link_libraries(ceph global ${LIBEDIT_LIBS})
set(ceph_conf_srcs
tools/ceph_conf.cc)
add_executable(ceph-conf ${ceph_conf_srcs})
target_link_libraries(ceph-conf global)
install(TARGETS ceph-conf DESTINATION bin)
set(monmaptool_srcs
tools/monmaptool.cc)
add_executable(monmaptool ${monmaptool_srcs})
target_link_libraries(monmaptool global)
install(TARGETS monmaptool DESTINATION bin)
set(osdomaptool_srcs
tools/osdmaptool.cc)
add_executable(osdmaptool ${osdomaptool_srcs})
target_link_libraries(osdmaptool global ${CMAKE_DL_LIBS})
install(TARGETS osdmaptool DESTINATION bin)
set(ceph_authtool_srcs
tools/ceph_authtool.cc)
add_executable(ceph-authtool ${ceph_authtool_srcs})
target_link_libraries(ceph-authtool global ${EXTRALIBS} ${CRYPTO_LIBS})
install(TARGETS ceph-authtool DESTINATION bin)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-coverage.in
${CMAKE_BINARY_DIR}/ceph-coverage @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-debugpack.in
${CMAKE_BINARY_DIR}/ceph-debugpack @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph.in.cmake
${CMAKE_BINARY_DIR}/ceph @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-crush-location.in
${CMAKE_BINARY_DIR}/ceph-crush-location @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/src/init-ceph.in
${CMAKE_BINARY_DIR}/init-ceph @ONLY)
install(PROGRAMS
${CMAKE_BINARY_DIR}/ceph
${CMAKE_BINARY_DIR}/ceph-debugpack
${CMAKE_BINARY_DIR}/ceph-coverage
${CMAKE_BINARY_DIR}/init-ceph
${CMAKE_SOURCE_DIR}/src/ceph-run
${CMAKE_SOURCE_DIR}/src/vstart.sh
${CMAKE_SOURCE_DIR}/src/ceph-clsinfo
DESTINATION bin)
install(FILES
${CMAKE_SOURCE_DIR}/doc/start/ceph.conf
DESTINATION ${sysconfdir}/ceph/ RENAME ceph.conf.example)
install(PROGRAMS
${CMAKE_SOURCE_DIR}/src/ceph_common.sh
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/ceph)
install(PROGRAMS
${CMAKE_SOURCE_DIR}/src/ceph-create-keys
${CMAKE_SOURCE_DIR}/src/ceph-disk
${CMAKE_SOURCE_DIR}/src/ceph-disk-udev
DESTINATION sbin)
set(parse_secret_files
common/secret.c)
add_library(parse_secret_objs OBJECT ${parse_secret_files})
if(WITH_LIBCEPHFS)
set(libclient_srcs
client/Client.cc
client/Dentry.cc
client/Inode.cc
client/MetaRequest.cc
client/ClientSnapRealm.cc
client/MetaSession.cc
client/Trace.cc)
add_library(client ${libclient_srcs})
target_link_libraries(client osdc mds ${LIBEDIT_LIBS})
set(libcephfs_srcs libcephfs.cc)
add_library(cephfs SHARED ${libcephfs_srcs})
target_link_libraries(cephfs client global)
install(TARGETS cephfs DESTINATION lib)
install(DIRECTORY
"${CMAKE_SOURCE_DIR}/src/include/cephfs"
DESTINATION include)
set(ceph_syn_srcs
ceph_syn.cc
client/SyntheticClient.cc)
add_executable(ceph-syn ${ceph_syn_srcs})
target_link_libraries(ceph-syn client global)
set(mount_ceph_srcs
mount/mount.ceph.c)
add_executable(mount.ceph ${mount_ceph_srcs}
$<TARGET_OBJECTS:parse_secret_objs>
$<TARGET_OBJECTS:common_mountcephfs_objs>)
target_link_libraries(mount.ceph keyutils)
install(TARGETS ceph-syn DESTINATION bin)
install(TARGETS mount.ceph DESTINATION sbin)
if(WITH_FUSE)
set(ceph_fuse_srcs
ceph_fuse.cc
client/fuse_ll.cc)
add_executable(ceph-fuse ${ceph_fuse_srcs})
target_link_libraries(ceph-fuse fuse client global)
install(TARGETS ceph-fuse DESTINATION bin)
endif(WITH_FUSE)
endif(WITH_LIBCEPHFS)
if(${WITH_RBD})
set(librbd_srcs
krbd.cc
common/ContextCompletion.cc
librbd/AioCompletion.cc
librbd/AioRequest.cc
librbd/AsyncFlattenRequest.cc
librbd/AsyncObjectThrottle.cc
librbd/AsyncOperation.cc
librbd/AsyncRequest.cc
librbd/AsyncResizeRequest.cc
librbd/AsyncTrimRequest.cc
librbd/CopyupRequest.cc
librbd/ImageCtx.cc
librbd/ImageWatcher.cc
librbd/WatchNotifyTypes.cc
librbd/internal.cc
librbd/librbd.cc
librbd/LibrbdWriteback.cc
librbd/ObjectMap.cc
librbd/RebuildObjectMapRequest.cc)
add_library(librbd ${CEPH_SHARED} ${librbd_srcs}
$<TARGET_OBJECTS:osdc_rbd_objs>
$<TARGET_OBJECTS:common_util_obj>)
target_link_libraries(librbd PRIVATE librados common cls_lock_client cls_rbd_client
${CMAKE_DL_LIBS})
if(${ENABLE_SHARED})
set_target_properties(librbd PROPERTIES VERSION "1.0.0" SOVERSION "1"
OUTPUT_NAME rbd)
endif(${ENABLE_SHARED})
install(TARGETS librados librbd DESTINATION lib)
set(rbd_srcs
rbd.cc common/TextTable.cc)
add_executable(rbd ${rbd_srcs} $<TARGET_OBJECTS:common_util_obj>
$<TARGET_OBJECTS:parse_secret_objs>
$<TARGET_OBJECTS:heap_profiler_objs>)
set_target_properties(rbd PROPERTIES OUTPUT_NAME rbd)
target_link_libraries(rbd librbd librados common keyutils udev
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
install(TARGETS rbd DESTINATION bin)
install(PROGRAMS ${CMAKE_SOURCE_DIR}/src/ceph-rbdnamer DESTINATION bin)
endif(${WITH_RBD})
# RadosGW
if(${WITH_KVS})
set(kvs_srcs
key_value_store/cls_kvs.cc)
add_library(cls_kvs SHARED ${kvs_srcs})
set_target_properties(cls_kvs PROPERTIES VERSION "1.0.0" SOVERSION "1")
install(TARGETS cls_kvs DESTINATION lib/rados-classes)
endif(${WITH_KVS})
if(${WITH_RADOSGW})
set(rgw_a_srcs
rgw/librgw.cc
rgw/rgw_acl.cc
rgw/rgw_acl_s3.cc
rgw/rgw_acl_swift.cc
rgw/rgw_client_io.cc
rgw/rgw_fcgi.cc
rgw/rgw_xml.cc
rgw/rgw_usage.cc
rgw/rgw_json_enc.cc
rgw/rgw_user.cc
rgw/rgw_bucket.cc
rgw/rgw_tools.cc
rgw/rgw_rados.cc
rgw/rgw_http_client.cc
rgw/rgw_rest_client.cc
rgw/rgw_rest_conn.cc
rgw/rgw_op.cc
rgw/rgw_common.cc
rgw/rgw_cache.cc
rgw/rgw_formats.cc
rgw/rgw_log.cc
rgw/rgw_multi.cc
rgw/rgw_policy_s3.cc
rgw/rgw_gc.cc
rgw/rgw_multi_del.cc
rgw/rgw_env.cc
rgw/rgw_cors.cc
rgw/rgw_cors_s3.cc
rgw/rgw_auth_s3.cc
rgw/rgw_metadata.cc
rgw/rgw_replica_log.cc
rgw/rgw_keystone.cc
rgw/rgw_quota.cc
rgw/rgw_dencoder.cc)
add_library(rgw_a STATIC ${rgw_a_srcs})
include_directories("${CMAKE_SOURCE_DIR}/src/civetweb/include")
set(radosgw_srcs
rgw/rgw_resolve.cc
rgw/rgw_rest.cc
rgw/rgw_rest_swift.cc
rgw/rgw_rest_s3.cc
rgw/rgw_rest_usage.cc
rgw/rgw_rest_user.cc
rgw/rgw_rest_bucket.cc
rgw/rgw_rest_metadata.cc
rgw/rgw_replica_log.cc
rgw/rgw_rest_log.cc
rgw/rgw_rest_opstate.cc
rgw/rgw_rest_replica_log.cc
rgw/rgw_rest_config.cc
rgw/rgw_http_client.cc
rgw/rgw_swift.cc
rgw/rgw_swift_auth.cc
rgw/rgw_loadgen.cc
rgw/rgw_civetweb.cc
rgw/rgw_civetweb_log.cc
civetweb/src/civetweb.c
rgw/rgw_main.cc)
set(radosgw_admin_srcs
rgw/rgw_admin.cc
rgw/rgw_orphan.cc)
add_executable(radosgw ${radosgw_srcs} $<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(radosgw rgw_a librados
cls_rgw_client cls_lock_client cls_refcount_client
cls_log_client cls_statelog_client cls_version_client
cls_replica_log_client cls_user_client
curl expat global fcgi resolv ${BLKID_LIBRARIES} ${TCMALLOC_LIBS})
install(TARGETS radosgw DESTINATION bin)
add_executable(radosgw-admin ${radosgw_admin_srcs} $<TARGET_OBJECTS:heap_profiler_objs>)
target_link_libraries(radosgw-admin rgw_a librados
cls_rgw_client cls_lock_client cls_refcount_client
cls_log_client cls_statelog_client cls_version_client
cls_replica_log_client cls_user_client
curl expat global fcgi resolv ${BLKID_LIBRARIES} ${TCMALLOC_LIBS})
install(TARGETS radosgw-admin DESTINATION bin)
endif(${WITH_RADOSGW})