]> git.proxmox.com Git - ceph.git/blame - ceph/src/CMakeLists.txt
bump version to 12.0.3-pve3
[ceph.git] / ceph / src / CMakeLists.txt
CommitLineData
7c673cae
FG
1include(GetGitRevisionDescription)
2
3enable_language(C ASM)
4include(GNUInstallDirs)
5# for erasure and compressor plugins
6set(CMAKE_INSTALL_PKGLIBDIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})
7set(CMAKE_INSTALL_FULL_PKGLIBDIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME})
8# so libceph-common can be found
9set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
10if(NOT CMAKE_INSTALL_RPATH)
11 set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_PKGLIBDIR}")
12endif()
13
14# to be compatible with configure_files shared with autoconfig
15set(bindir ${CMAKE_INSTALL_FULL_BINDIR})
16set(sbindir ${CMAKE_INSTALL_FULL_SBINDIR})
17set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
18set(sysconfdir ${CMAKE_INSTALL_FULL_SYSCONFDIR})
19set(libexecdir ${CMAKE_INSTALL_FULL_LIBEXECDIR})
20set(pkgdatadir ${CMAKE_INSTALL_FULL_DATADIR})
21set(datadir ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME})
22set(prefix ${CMAKE_INSTALL_PREFIX})
23
24add_definitions("-DCEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"")
25add_definitions("-DCEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\"")
26add_definitions("-DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS")
27add_definitions("-D_FILE_OFFSET_BITS=64")
28if(LINUX)
29 add_definitions("-D_GNU_SOURCE")
30endif()
31
32set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wtype-limits -Wignored-qualifiers -Winit-self")
33set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char")
34
35set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-1024 -Wno-invalid-offsetof")
36set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor")
37set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas")
38set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas")
39if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
40 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic")
41 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstrict-null-sentinel -Woverloaded-virtual")
42 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
43elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
44 set(CMAKE_EXE_LINKER_FLAGS "-Wl,-export-dynamic")
45 set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -rdynamic -Wl,-export-dynamic -export-dynamic")
46 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override -Wno-mismatched-tags")
47 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field")
48 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function")
49 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedef")
50 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-varargs")
51 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-designator")
52 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-braces -Wno-parentheses -Wno-deprecated-register")
53endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
54set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}")
55
56if(NOT CMAKE_BUILD_TYPE)
57 set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Default BUILD_TYPE is RelWithDebInfo, other options are: Debug, Release, and MinSizeRel." FORCE)
58endif()
59
60if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
61 # we use assert(3) for testing, so scrub the -DNDEBUG defined by default
62 string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_upper)
63 foreach(flags
64 CMAKE_CXX_FLAGS_${build_type_upper}
65 CMAKE_C_FLAGS_${build_type_upper})
66 string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " "${flags}" "${${flags}}")
67 endforeach()
68endif()
69
70include(CheckCCompilerFlag)
71if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
72 CHECK_C_COMPILER_FLAG("-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2" HAS_FORTIFY_SOURCE)
73 if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
74 if(HAS_FORTIFY_SOURCE)
75 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2")
76 set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2")
77 endif()
78 endif()
79 CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STACK_PROTECT)
80 if (HAS_STACK_PROTECT)
81 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong")
82 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
83 endif()
84endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
85
86include(SIMDExt)
87if(HAVE_INTEL)
88 set(CMAKE_ASM_COMPILER ${PROJECT_SOURCE_DIR}/src/yasm-wrapper)
89 set(CMAKE_ASM_FLAGS "-f elf64")
90endif()
91
92execute_process(
93 COMMAND yasm -f elf64 ${CMAKE_SOURCE_DIR}/src/common/crc32c_intel_fast_asm.S -o /dev/null
94 RESULT_VARIABLE no_yasm
95 OUTPUT_QUIET)
96if(no_yasm)
97 message(STATUS " we do not have a modern/working yasm")
98else(no_yasm)
99 message(STATUS " we have a modern and working yasm")
100 if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64")
101 message(STATUS " we are x84_64")
102 set(save_quiet ${CMAKE_REQUIRED_QUIET})
103 set(CMAKE_REQUIRED_QUIET true)
104 include(CheckCXXSourceCompiles)
105 check_cxx_source_compiles("
106 #if defined(__x86_64__) && defined(__ILP32__)
107 #error x32
108 #endif
109 int main() {}
110 " not_arch_x32)
111 set(CMAKE_REQUIRED_QUIET ${save_quiet})
112 if(not_arch_x32)
113 message(STATUS " we are not x32")
114 set(HAVE_GOOD_YASM_ELF64 1)
115 execute_process(COMMAND yasm -f elf64 -i
116 ${CMAKE_SOURCE_DIR}/src/erasure-code/isa/isa-l/include/
117 ${CMAKE_SOURCE_DIR}/src/erasure-code/isa/isa-l/erasure_code/gf_vect_dot_prod_avx2.asm.s
118 -o /dev/null
119 RESULT_VARIABLE rc
120 OUTPUT_QUIET)
121 if(NOT rc)
122 set(HAVE_BETTER_YASM_ELF64 1)
123 message(STATUS " yasm can also build the isa-l stuff")
124 endif(NOT rc)
125 else(not_arch_x32)
126 message(STATUS " we are x32; no yasm for you")
127 endif(not_arch_x32)
128 else(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64")
129 message(STATUS " we are not x86_64 && !x32")
130 endif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64")
131endif(no_yasm)
132
133# require c++11
134if(CMAKE_VERSION VERSION_LESS "3.1")
135 include(CheckCXXCompilerFlag)
136 CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
137 if(NOT COMPILER_SUPPORTS_CXX11)
138 message(FATAL_ERROR
139 "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
140 endif()
141 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
142 include(CheckCCompilerFlag)
143 CHECK_C_COMPILER_FLAG("-std=gnu99" COMPILER_SUPPORTS_GNU99)
144 if(NOT COMPILER_SUPPORTS_GNU99)
145 message(FATAL_ERROR
146 "The compiler ${CMAKE_C_COMPILER} has no GNU C99 support.")
147 endif()
148 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
149else()
150 set(CMAKE_CXX_STANDARD 11)
151 set(CMAKE_CXX_EXTENSIONS OFF)
152 set(CMAKE_CXX_STANDARD_REQUIRED ON)
153 set(CMAKE_C_STANDARD 99)
154 # we use `asm()` to inline assembly, so enable the GNU extension
155 set(CMAKE_C_EXTENSIONS ON)
156 set(C_STANDARD_REQUIRED ON)
157endif()
158
159## Handle diagnostics color if compiler supports them.
160CHECK_C_COMPILER_FLAG("-fdiagnostics-color=always"
161 COMPILER_SUPPORTS_DIAGNOSTICS_COLOR)
162
163set(DIAGNOSTICS_COLOR "auto"
164 CACHE STRING "Used if the C/C++ compiler supports the -fdiagnostics-color option. May have one of three values -- 'auto' (default), 'always', or 'never'. If set to 'always' and the compiler supports the option, 'make [...] | less -R' will make visible diagnostics colorization of compiler output.")
165
166if(COMPILER_SUPPORTS_DIAGNOSTICS_COLOR)
167 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=${DIAGNOSTICS_COLOR}")
168 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=${DIAGNOSTICS_COLOR}")
169endif()
170
171set(EXTRALIBS rt ${CMAKE_DL_LIBS} ${ATOMIC_OPS_LIBRARIES})
172if(LINUX)
173 set(LIB_RESOLV resolv)
174 list(APPEND EXTRALIBS ${LIB_RESOLV})
175endif(LINUX)
176
177option(WITH_PROFILER "build extra profiler binaries" OFF)
178if(WITH_PROFILER)
179 find_package(gperftools REQUIRED)
180 list(APPEND EXTRALIBS profiler)
181endif(WITH_PROFILER)
182
183if(${ENABLE_COVERAGE})
184 find_program(HAVE_GCOV gcov)
185 if(NOT HAVE_GCOV)
186 message(FATAL_ERROR "Coverage Enabled but gcov Not Found")
187 endif(NOT HAVE_GCOV)
188 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -O0")
189 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
190 list(APPEND EXTRALIBS gcov)
191endif(${ENABLE_COVERAGE})
192
193if(USE_NSS)
194 if(NSS_FOUND)
195 if(NSPR_FOUND)
196 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${NSS_INCLUDE_DIR} -I${NSPR_INCLUDE_DIR}")
197 endif(NSPR_FOUND)
198 endif(NSS_FOUND)
199endif(USE_NSS)
200
201set(GCOV_PREFIX_STRIP 4)
202
203option(ENABLE_GIT_VERSION "build Ceph with git version string" ON)
204if(${ENABLE_GIT_VERSION})
205 get_git_head_revision(GIT_REFSPEC CEPH_GIT_VER)
206 git_describe(CEPH_GIT_NICE_VER --always)
207 #if building from a source tarball via make-dist
208 if(${CEPH_GIT_VER} STREQUAL "GITDIR-NOTFOUND")
209 message(STATUS "Ceph/.git directory not found, parsing ${CMAKE_CURRENT_SOURCE_DIR}/.git_version for CEPH_GIT_VER and CEPH_GIT_NICE_VER")
210 file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/.git_version CEPH_GIT_SHA_AND_TAG)
211 list(GET CEPH_GIT_SHA_AND_TAG 0 CEPH_GIT_VER)
212 list(GET CEPH_GIT_SHA_AND_TAG 1 CEPH_GIT_NICE_VER)
213 endif(${CEPH_GIT_VER} STREQUAL "GITDIR-NOTFOUND")
214 # remove 'v' prefix from raw git version
215 string(SUBSTRING ${CEPH_GIT_NICE_VER} 1 -1 CEPH_GIT_NICE_VER)
216else(${ENABLE_GIT_VERSION})
217 set(CEPH_GIT_VER "no_version")
218 set(CEPH_GIT_NICE_VER "Development")
219endif(${ENABLE_GIT_VERSION})
220
221option(WITH_OCF "build OCF-compliant cluster resource agent" OFF)
222if(WITH_OCF)
223 add_subdirectory(ocf)
224endif()
225
226option(WITH_CEPHFS_JAVA "build libcephfs Java bindings" OFF)
227if(WITH_CEPHFS_JAVA)
228 add_subdirectory(java)
229endif()
230
231# Python stuff
232find_package(PythonInterp 2 REQUIRED)
233find_package(PythonLibs 2 REQUIRED)
234
235option(WITH_PYTHON3 "build python3 bindings" "CHECK")
236if(WITH_PYTHON3 MATCHES "check|CHECK")
237 find_package(Python3Interp 3 QUIET)
238 find_package(Python3Libs 3 QUIET)
239 if(PYTHON3INTERP_FOUND AND PYTHON3LIBS_FOUND)
240 set(WITH_PYTHON3 ON)
241 else()
242 set(WITH_PYTHON3 OFF)
243 endif()
244elseif(WITH_PYTHON3)
245 find_package(Python3Interp 3 REQUIRED)
246 find_package(Python3Libs 3 REQUIRED)
247endif()
248
249if(HAVE_XIO)
250 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${XIO_INCLUDE_DIR}")
251 list(APPEND EXTRALIBS ${XIO_LIBRARY} pthread rt)
252endif(HAVE_XIO)
253
254if(HAVE_RDMA)
255 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${RDMA_INCLUDE_DIR}")
256 list(APPEND EXTRALIBS ${RDMA_LIBRARIES} pthread rt)
257endif(HAVE_RDMA)
258
259if(HAVE_DPDK)
260 set(CMAKE_CXX_FLAGS "-march=native ${CMAKE_CXX_FLAGS} -I${DPDK_INCLUDE_DIR}")
261 list(APPEND EXTRALIBS ${DPDK_LIBRARY})
262 if(NOT USE_CRYPTOPP)
263 message(FATAL_ERROR "CRYPTOPP must be supported when enable DPDK.")
264 endif(NOT USE_CRYPTOPP)
265 list(APPEND EXTRALIBS ${DPDK_LIBRARIES})
266endif(HAVE_DPDK)
267
268# sort out which allocator to use
269if(ALLOCATOR STREQUAL "tcmalloc")
270 set(ALLOC_LIBS ${GPERFTOOLS_TCMALLOC_LIBRARY})
271 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
272 set(TCMALLOC_srcs perfglue/heap_profiler.cc)
273elseif(ALLOCATOR STREQUAL "tcmalloc_minimal")
274 set(ALLOC_LIBS ${GPERFTOOLS_TCMALLOC_MINIMAL_LIBRARY})
275 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
276 set(TCMALLOC_srcs perfglue/disabled_heap_profiler.cc)
277elseif(ALLOCATOR STREQUAL "jemalloc")
278 set(ALLOC_LIBS ${JEMALLOC_LIBRARIES})
279 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
280 set(TCMALLOC_srcs perfglue/disabled_heap_profiler.cc)
281elseif(ALLOCATOR STREQUAL "libc")
282 set(TCMALLOC_srcs perfglue/disabled_heap_profiler.cc)
283endif()
284
285# tcmalloc heap profiler
286set(heap_profiler_files ${TCMALLOC_srcs})
287add_library(heap_profiler_objs OBJECT ${heap_profiler_files})
288
289if (WITH_BLKIN)
290 add_subdirectory(blkin/blkin-lib)
291endif(WITH_BLKIN)
292
293# Common infrastructure
294configure_file(
295 ${CMAKE_SOURCE_DIR}/src/ceph_ver.h.in.cmake
296 ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
297 @ONLY)
298
299set(auth_files
300 auth/AuthAuthorizeHandler.cc
301 auth/AuthClientHandler.cc
302 auth/AuthSessionHandler.cc
303 auth/AuthMethodList.cc
304 auth/cephx/CephxAuthorizeHandler.cc
305 auth/cephx/CephxClientHandler.cc
306 auth/cephx/CephxProtocol.cc
307 auth/cephx/CephxSessionHandler.cc
308 auth/none/AuthNoneAuthorizeHandler.cc
309 auth/unknown/AuthUnknownAuthorizeHandler.cc
310 auth/Crypto.cc
311 auth/KeyRing.cc
312 auth/RotatingKeyRing.cc)
313
314set(mds_files)
315list(APPEND mds_files
316 mds/MDSMap.cc
317 mds/FSMap.cc
318 mds/FSMapUser.cc
319 mds/inode_backtrace.cc
320 mds/mdstypes.cc
321 mds/flock.cc)
322
323set(crush_srcs
324 crush/builder.c
325 crush/mapper.c
326 crush/crush.c
327 crush/hash.c
328 crush/CrushWrapper.cc
329 crush/CrushCompiler.cc
330 crush/CrushTester.cc
331 crush/CrushLocation.cc)
332
333add_library(crush_objs OBJECT ${crush_srcs})
334
335add_subdirectory(json_spirit)
336
337include_directories("${CMAKE_SOURCE_DIR}/src/xxHash")
338
339set(GMOCK_INCLUDE_DIRS
340 "${CMAKE_SOURCE_DIR}/src/googletest/googletest/include/gmock")
341set(GTEST_INCLUDE_DIRS
342 "${CMAKE_SOURCE_DIR}/src/googletest/googletest/include/gtest")
343
344include_directories("${CMAKE_SOURCE_DIR}/src/dmclock/src")
345include_directories("${CMAKE_SOURCE_DIR}/src/dmclock/support/src")
346
347# needed for source files that friend unit tests (e.g., using FRIEND_TEST)
348include_directories("${CMAKE_SOURCE_DIR}/src/googletest/googletest/include")
349
350set(xio_common_srcs)
351if(HAVE_XIO)
352 list(APPEND xio_common_srcs
353 msg/xio/XioConnection.cc
354 msg/xio/XioMsg.cc
355 msg/xio/XioPool.cc
356 msg/xio/XioMessenger.cc
357 msg/xio/XioPortal.cc)
358endif(HAVE_XIO)
359
360set(async_rdma_common_srcs)
361if(HAVE_RDMA)
362 list(APPEND async_rdma_common_srcs
363 msg/async/rdma/Infiniband.cc
364 msg/async/rdma/Device.cc
365 msg/async/rdma/RDMAConnectedSocketImpl.cc
366 msg/async/rdma/RDMAConnTCP.cc
367 msg/async/rdma/RDMAServerSocketImpl.cc
368 msg/async/rdma/RDMAStack.cc)
369endif(HAVE_RDMA)
370
371set(dpdk_common_srcs)
372if(HAVE_DPDK)
373 list(APPEND dpdk_common_srcs
374 msg/async/dpdk/ARP.cc
375 msg/async/dpdk/DPDK.cc
376 msg/async/dpdk/dpdk_rte.cc
377 msg/async/dpdk/DPDKStack.cc
378 msg/async/dpdk/EventDPDK.cc
379 msg/async/dpdk/IP.cc
380 msg/async/dpdk/net.cc
381 msg/async/dpdk/IPChecksum.cc
382 msg/async/dpdk/Packet.cc
383 msg/async/dpdk/TCP.cc
384 msg/async/dpdk/UserspaceEvent.cc
385 msg/async/dpdk/ethernet.cc)
386 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${DPDK_INCLUDE_DIR}")
387endif(HAVE_DPDK)
388
389add_library(common_buffer_obj OBJECT
390 common/buffer.cc)
391
392add_library(common_texttable_obj OBJECT
393 common/TextTable.cc)
394
395set(libcommon_files
396 ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
397 ceph_ver.c
398 common/AsyncOpTracker.cc
399 common/DecayCounter.cc
400 common/LogClient.cc
401 common/LogEntry.cc
402 common/PrebufferedStreambuf.cc
403 common/BackTrace.cc
404 common/perf_counters.cc
405 common/perf_histogram.cc
406 common/mutex_debug.cc
407 common/Mutex.cc
408 common/OutputDataSocket.cc
409 common/admin_socket.cc
410 common/admin_socket_client.cc
411 common/bloom_filter.cc
412 common/Readahead.cc
413 common/cmdparse.cc
414 common/escape.c
415 common/url_escape.cc
416 common/io_priority.cc
417 common/Clock.cc
418 common/ceph_time.cc
419 common/mempool.cc
420 common/Throttle.cc
421 common/Timer.cc
422 common/Finisher.cc
423 common/environment.cc
424 common/sctp_crc32.c
425 common/crc32c.cc
426 common/crc32c_intel_baseline.c
427 xxHash/xxhash.c
428 common/assert.cc
429 common/run_cmd.cc
430 common/WorkQueue.cc
431 common/ConfUtils.cc
432 common/MemoryModel.cc
433 common/fd.cc
434 common/xattr.c
435 common/str_list.cc
436 common/str_map.cc
437 common/snap_types.cc
438 common/errno.cc
439 common/TrackedOp.cc
440 common/SloppyCRCMap.cc
441 common/types.cc
442 log/Log.cc
443 log/SubsystemMap.cc
444 mon/MonCap.cc
445 mon/MonClient.cc
446 mon/MonMap.cc
447 mgr/MgrClient.cc
448 msg/simple/Accepter.cc
449 msg/DispatchQueue.cc
450 msg/Message.cc
451 osd/ECMsgTypes.cc
452 osd/HitSet.cc
453 common/RefCountedObj.cc
454 msg/Messenger.cc
455 msg/simple/Pipe.cc
456 msg/simple/PipeConnection.cc
457 msg/simple/SimpleMessenger.cc
458 msg/async/AsyncConnection.cc
459 msg/async/AsyncMessenger.cc
460 msg/async/Event.cc
461 msg/async/EventSelect.cc
462 msg/async/Stack.cc
463 msg/async/PosixStack.cc
464 msg/async/net_handler.cc
465 msg/QueueStrategy.cc
466 ${xio_common_srcs}
467 ${async_rdma_common_srcs}
468 ${dpdk_common_srcs}
469 msg/msg_types.cc
470 common/hobject.cc
471 osd/OSDMap.cc
472 osd/OSDMapMapping.cc
473 common/histogram.cc
474 osd/osd_types.cc
475 osd/OpRequest.cc
476 common/blkdev.cc
477 common/common_init.cc
478 common/pipe.c
479 common/ceph_argparse.cc
480 common/ceph_context.cc
481 common/code_environment.cc
482 common/dout.cc
483 common/signal.cc
484 common/Thread.cc
485 common/Formatter.cc
486 common/HTMLFormatter.cc
487 common/HeartbeatMap.cc
488 common/PluginRegistry.cc
489 common/ceph_fs.cc
490 common/ceph_hash.cc
491 common/ceph_strings.cc
492 common/ceph_frag.cc
493 common/config.cc
494 common/config_validators.cc
495 common/utf8.c
496 common/mime.c
497 common/strtol.cc
498 common/page.cc
499 common/lockdep.cc
500 common/version.cc
501 common/hex.cc
502 common/entity_name.cc
503 common/ceph_crypto.cc
504 common/ceph_crypto_cms.cc
505 common/ceph_json.cc
506 common/ipaddr.cc
507 common/pick_address.cc
508 common/address_helper.cc
509 common/linux_version.c
510 common/TracepointProvider.cc
511 common/Cycles.cc
512 common/scrub_types.cc
513 common/bit_str.cc
514 osdc/Striper.cc
515 osdc/Objecter.cc
516 common/Graylog.cc
517 common/fs_types.cc
518 common/dns_resolve.cc
519 common/hostname.cc
520 arch/probe.cc
521 ${auth_files}
522 ${mds_files})
523
524if(HAVE_ARM)
525 list(APPEND libcommon_files arch/arm.c)
526elseif(HAVE_INTEL)
527 list(APPEND libcommon_files arch/intel.c)
528elseif(HAVE_POWER8)
529 list(APPEND libcommon_files arch/ppc.c)
530endif()
531
532if(HAVE_INTEL)
533 list(APPEND libcommon_files
534 common/crc32c_intel_fast.c)
535 if(HAVE_GOOD_YASM_ELF64)
536 list(APPEND libcommon_files
537 common/crc32c_intel_fast_asm.S
538 common/crc32c_intel_fast_zero_asm.S)
539 endif(HAVE_GOOD_YASM_ELF64)
540elseif(HAVE_POWER8)
541 list(APPEND libcommon_files
542 common/crc32c_ppc.c
543 common/crc32c_ppc_asm.S)
544endif(HAVE_INTEL)
545
546if(LINUX)
547 list(APPEND libcommon_files msg/async/EventEpoll.cc)
548 message(STATUS " Using EventEpoll for events.")
549elseif(FREEBSD OR APPLE)
550 list(APPEND libcommon_files msg/async/EventKqueue.cc)
551 message(STATUS " Using EventKqueue for events.")
552endif(LINUX)
553
554if(WITH_LTTNG AND WITH_EVENTTRACE)
555 message(STATUS " Using EventTrace class.")
556 add_definitions("-DWITH_EVENTTRACE")
557 list(APPEND libcommon_files common/EventTrace.cc)
558endif()
559
560set(mon_common_files
561 auth/AuthSessionHandler.cc
562 auth/cephx/CephxSessionHandler.cc
563 erasure-code/ErasureCodePlugin.cc)
564add_library(mon_common_objs OBJECT ${mon_common_files})
565set(common_mountcephfs_files
566 common/armor.c
567 common/safe_io.c
568 common/module.c
569 common/addr_parsing.c)
570add_library(common_mountcephfs_objs OBJECT
571 ${common_mountcephfs_files})
572
573if(WITH_PROFILER)
574 list(APPEND libcommon_files
575 perfglue/cpu_profiler.cc)
576else()
577 list(APPEND libcommon_files
578 perfglue/disabled_stubs.cc)
579endif()
580
581add_library(common-objs OBJECT ${libcommon_files})
582set(ceph_common_objs
583 $<TARGET_OBJECTS:common_buffer_obj>
584 $<TARGET_OBJECTS:common_texttable_obj>
585 $<TARGET_OBJECTS:compressor_objs>
586 $<TARGET_OBJECTS:common-objs>
587 $<TARGET_OBJECTS:common_mountcephfs_objs>
588 $<TARGET_OBJECTS:global_common_objs>
589 $<TARGET_OBJECTS:crush_objs>)
590set(ceph_common_deps
591 json_spirit erasure_code rt ${LIB_RESOLV}
592 ${Boost_THREAD_LIBRARY}
593 ${Boost_SYSTEM_LIBRARY}
594 ${Boost_REGEX_LIBRARY}
595 ${Boost_RANDOM_LIBRARY}
596 ${Boost_PROGRAM_OPTIONS_LIBRARY}
597 ${Boost_DATE_TIME_LIBRARY}
598 ${Boost_IOSTREAMS_LIBRARY}
599 ${BLKID_LIBRARIES}
600 ${Backtrace_LIBRARIES}
601 ${BLKIN_LIBRARIES}
602 ${CRYPTO_LIBS}
603 ${CMAKE_THREAD_LIBS_INIT}
604 ${CMAKE_DL_LIBS})
605if(HAVE_RDMA)
606 list(APPEND ceph_common_deps ${RDMA_LIBRARY})
607endif()
608if(NOT WITH_SYSTEM_BOOST)
609 list(APPEND ceph_common_deps ${ZLIB_LIBRARIES})
610endif()
611
612set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ceph_ver.c
613 ${CMAKE_SOURCE_DIR}/src/common/version.cc
614 ${CMAKE_SOURCE_DIR}/src/test/encoding/ceph_dencoder.cc
615 APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h)
616
617if(HAVE_ARMV8_CRC)
618 add_library(common_crc_aarch64 STATIC common/crc32c_aarch64.c)
619 set_target_properties(common_crc_aarch64 PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} ${ARMV8_CRC_COMPILE_FLAGS}")
620 list(APPEND ceph_common_deps common_crc_aarch64)
621endif(HAVE_ARMV8_CRC)
622
623add_library(common STATIC ${ceph_common_objs})
624target_link_libraries(common ${ceph_common_deps})
625
626add_library(ceph-common SHARED ${ceph_common_objs})
627target_link_libraries(ceph-common ${ceph_common_deps})
628# appease dpkg-shlibdeps
629set_target_properties(ceph-common PROPERTIES
630 SOVERSION 0
631 INSTALL_RPATH "")
632install(TARGETS ceph-common DESTINATION ${CMAKE_INSTALL_PKGLIBDIR})
633
634add_library(common_utf8 STATIC common/utf8.c)
635
636target_link_libraries(common json_spirit common_utf8 erasure_code rt uuid resolv ${CRYPTO_LIBS} ${Boost_LIBRARIES} ${BLKID_LIBRARIES} ${EXECINFO_LIBRARIES} ${BLKIN_LIBRARIES})
637if(${WITH_LTTNG})
638 add_subdirectory(tracing)
639 add_dependencies(common-objs oprequest-tp)
640endif(${WITH_LTTNG})
641
642add_subdirectory(global)
643
644add_subdirectory(lua)
645
646# rados object classes
647add_subdirectory(cls)
648
649# RADOS client/library
650add_subdirectory(osdc)
651
652add_library(rados_snap_set_diff_obj OBJECT librados/snap_set_diff.cc)
653
654add_subdirectory(include)
655add_subdirectory(librados)
656add_subdirectory(libradosstriper)
657
658if (WITH_MGR)
659 set(mgr_srcs
660 ceph_mgr.cc
661 mon/PGMap.cc
662 mgr/DaemonState.cc
663 mgr/DaemonServer.cc
664 mgr/ClusterState.cc
665 mgr/PyModules.cc
666 mgr/PyFormatter.cc
667 mgr/PyState.cc
668 mgr/MgrPyModule.cc
669 mgr/MgrStandby.cc
670 mgr/Mgr.cc)
671 add_executable(ceph-mgr ${mgr_srcs}
672 $<TARGET_OBJECTS:heap_profiler_objs>)
673 target_include_directories(ceph-mgr PRIVATE "${PYTHON_INCLUDE_DIRS}")
674 target_link_libraries(ceph-mgr osdc client global-static common
675 ${Boost_PYTHON_LIBRARY} ${PYTHON_LIBRARIES} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
676 install(TARGETS ceph-mgr DESTINATION bin)
677endif (WITH_MGR)
678
679set(librados_config_srcs
680 librados-config.cc)
681add_executable(librados-config ${librados_config_srcs})
682target_link_libraries(librados-config librados global ${BLKID_LIBRARIES} ${RDMA_LIBRARIES}
683 ${CMAKE_DL_LIBS})
684
685install(TARGETS librados-config DESTINATION bin)
686
687# virtualenv base directory for ceph-disk and ceph-detect-init
688set(CEPH_BUILD_VIRTUALENV $ENV{TMPDIR})
689if(NOT CEPH_BUILD_VIRTUALENV)
690 set(CEPH_BUILD_VIRTUALENV /tmp)
691endif()
692
693add_subdirectory(pybind)
694add_subdirectory(ceph-disk)
695add_subdirectory(ceph-detect-init)
696
697## dencoder
698CHECK_C_COMPILER_FLAG("-fvar-tracking-assignments" HAS_VTA)
699if(HAS_VTA)
700 set_source_files_properties(test/encoding/ceph_dencoder.cc
701 PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments)
702endif()
703
704set(dencoder_srcs
705 test/encoding/ceph_dencoder.cc
706 $<TARGET_OBJECTS:common_texttable_obj>
707 )
708if(${WITH_RADOSGW})
709 list(APPEND dencoder_srcs
710 rgw/rgw_dencoder.cc
711 )
712 set(DENCODER_EXTRALIBS
713 rgw_a
714 cls_rgw_client
715 )
716endif(${WITH_RADOSGW})
717if(WITH_RBD)
718 set(DENCODER_EXTRALIBS
719 ${DENCODER_EXTRALIBS}
720 cls_rbd_client
721 rbd_mirror_types
722 rbd_types
723 rbd_replay_types)
724 if(WITH_KRBD)
725 set(DENCODER_EXTRALIBS
726 ${DENCODER_EXTRALIBS}
727 krbd)
728 endif()
729endif(WITH_RBD)
730
731add_executable(ceph-dencoder ${dencoder_srcs})
732target_link_libraries(ceph-dencoder
733 global
734 os
735 osd
736 mds
737 mon
738 journal
739 ${DENCODER_EXTRALIBS}
740 cls_lock_client
741 cls_refcount_client
742 cls_log_client
743 cls_statelog_client
744 cls_version_client
745 cls_replica_log_client
746 cls_user_client
747 cls_journal_client
748 cls_timeindex_client
749 ${EXTRALIBS}
750 ${CMAKE_DL_LIBS}
751 )
752install(TARGETS ceph-dencoder DESTINATION bin)
753
754# Monitor
755set(common_util_src
756 common/util.cc)
757add_library(common_util_obj OBJECT ${common_util_src})
758
759add_subdirectory(mon)
760set(ceph_mon_srcs
761 ceph_mon.cc)
762add_executable(ceph-mon ${ceph_mon_srcs}
763 $<TARGET_OBJECTS:common_texttable_obj>)
764add_dependencies(ceph-mon erasure_code_plugins)
765target_link_libraries(ceph-mon mon common os global-static common
766 ${EXTRALIBS}
767 ${CMAKE_DL_LIBS})
768install(TARGETS ceph-mon DESTINATION bin)
769
770# OSD/ObjectStore
771# make rocksdb statically
772
773if (NOT WITH_SYSTEM_ROCKSDB)
774 set(ROCKSDB_CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
775
776 if(ALLOCATOR STREQUAL "jemalloc")
777 list(APPEND ROCKSDB_CMAKE_ARGS -DWITH_JEMALLOC=ON)
778 endif()
779
780 if (WITH_CCACHE AND CCACHE_FOUND)
781 list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_COMPILER=ccache)
782 list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_COMPILER_ARG1=${CMAKE_CXX_COMPILER})
783 else(WITH_CCACHE AND CCACHE_FOUND)
784 list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
785 endif(WITH_CCACHE AND CCACHE_FOUND)
786
787 # We really want to have the CRC32 calculation in RocksDB accelerated
788 # with SSE 4.2. For details refer to rocksdb/util/crc32c.cc.
789 if (HAVE_INTEL_SSE4_2)
790 list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_FLAGS=${SIMD_COMPILE_FLAGS})
791 else()
792 list(APPEND ROCKSDB_CMAKE_ARGS -DWITH_SSE42=OFF)
793 endif()
794 list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_AR=${CMAKE_AR})
795 list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
796
797 if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
798 list(APPEND ROCKSDB_CMAKE_ARGS -DFAIL_ON_WARNINGS=OFF)
799 endif()
800
801 # we use an external project and copy the sources to bin directory to ensure
802 # that object files are built outside of the source tree.
803 include(ExternalProject)
804 ExternalProject_Add(rocksdb_ext
805 SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb
806 CMAKE_ARGS ${ROCKSDB_CMAKE_ARGS}
807 BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/rocksdb
808 BUILD_COMMAND $(MAKE) rocksdb
809 INSTALL_COMMAND "true")
810
811 # force rocksdb make to be called on each time
812 ExternalProject_Add_Step(rocksdb_ext forcebuild
813 DEPENDEES configure
814 DEPENDERS build
815 COMMAND "true"
816 ALWAYS 1)
817
818 set(ROCKSDB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/include)
819
820 add_library(rocksdb STATIC IMPORTED)
821 add_dependencies(rocksdb rocksdb_ext)
822 set_property(TARGET rocksdb PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/rocksdb/librocksdb.a")
823 set(ROCKSDB_LIBRARIES rocksdb)
824
825endif(NOT WITH_SYSTEM_ROCKSDB)
826
827include(TestBigEndian)
828test_big_endian(CEPH_BIG_ENDIAN)
829if(NOT CEPH_BIG_ENDIAN)
830 set(CEPH_LITTLE_ENDIAN 1)
831endif()
832
833add_subdirectory(kv)
834add_subdirectory(os)
835
836set(cls_references_files objclass/class_api.cc)
837add_library(cls_references_objs OBJECT ${cls_references_files})
838
839add_subdirectory(osd)
840
841set(ceph_osd_srcs
842 ceph_osd.cc)
843add_executable(ceph-osd ${ceph_osd_srcs}
844 $<TARGET_OBJECTS:common_util_obj>)
845add_dependencies(ceph-osd erasure_code_plugins)
846target_link_libraries(ceph-osd osd os global-static common
847 ${BLKID_LIBRARIES} ${RDMA_LIBRARIES})
848if(WITH_FUSE)
849 target_link_libraries(ceph-osd ${FUSE_LIBRARIES})
850endif()
851install(TARGETS ceph-osd DESTINATION bin)
852
853add_subdirectory(mds)
854set(ceph_mds_srcs
855 ceph_mds.cc)
856add_executable(ceph-mds ${ceph_mds_srcs}
857 $<TARGET_OBJECTS:common_util_obj>)
858target_link_libraries(ceph-mds mds ${CMAKE_DL_LIBS} global-static common
859 ${Boost_THREAD_LIBRARY})
860install(TARGETS ceph-mds DESTINATION bin)
861
862add_subdirectory(erasure-code)
863
864# Support/Tools
865if(WITH_TESTS)
866add_subdirectory(googletest/googlemock)
867add_subdirectory(test)
868endif(WITH_TESTS)
869
870add_subdirectory(compressor)
871
872add_subdirectory(tools)
873
874# dmClock
875
876add_subdirectory(dmclock) # after gmock
877add_dependencies(tests dmclock-tests dmclock-data-struct-tests)
878
879if(WITH_TESTS)
880 install(PROGRAMS
881 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dmclock-tests
882 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dmclock-data-struct-tests
883 DESTINATION bin)
884endif(WITH_TESTS)
885
886if(HAVE_INTEL)
887 add_subdirectory(crypto/isa-l)
888endif(HAVE_INTEL)
889
890if(WITH_TESTS)
891
892configure_file(${CMAKE_SOURCE_DIR}/src/ceph-coverage.in
893 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage @ONLY)
894
895configure_file(${CMAKE_SOURCE_DIR}/src/ceph-debugpack.in
896 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack @ONLY)
897endif(WITH_TESTS)
898
899configure_file(${CMAKE_SOURCE_DIR}/src/ceph.in
900 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph @ONLY)
901
902configure_file(${CMAKE_SOURCE_DIR}/src/ceph-crush-location.in
903 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-crush-location @ONLY)
904
905configure_file(${CMAKE_SOURCE_DIR}/src/init-ceph.in
906 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/init-ceph @ONLY)
907
908configure_file(ceph-post-file.in
909 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file @ONLY)
910
911if(WITH_TESTS)
912install(PROGRAMS
913 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack
914 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage
915 DESTINATION bin)
916endif(WITH_TESTS)
917
918install(PROGRAMS
919 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph
920 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-crush-location
921 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file
922 ${CMAKE_SOURCE_DIR}/src/ceph-run
923 ${CMAKE_SOURCE_DIR}/src/ceph-rest-api
924 ${CMAKE_SOURCE_DIR}/src/ceph-clsinfo
925 DESTINATION bin)
926install(PROGRAMS
927 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/init-ceph
928 DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/init.d
929 RENAME ceph)
930
931install(FILES
932 ${CMAKE_SOURCE_DIR}/share/id_rsa_drop.ceph.com
933 ${CMAKE_SOURCE_DIR}/share/id_rsa_drop.ceph.com.pub
934 ${CMAKE_SOURCE_DIR}/share/known_hosts_drop.ceph.com
935 DESTINATION ${CMAKE_INSTALL_DATADIR}/ceph)
936
937install(PROGRAMS
938 ceph_common.sh
939 ceph-osd-prestart.sh
940 DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/ceph)
941
942install(PROGRAMS
943 ${CMAKE_SOURCE_DIR}/src/ceph-create-keys
944# ${CMAKE_SOURCE_DIR}/src/ceph-disk
945 ${CMAKE_SOURCE_DIR}/src/ceph-disk-udev
946 DESTINATION sbin)
947
948add_subdirectory(bash_completion)
949
950if(WITH_LIBCEPHFS OR WITH_KRBD)
951 set(parse_secret_files
952 common/secret.c)
953 add_library(parse_secret_objs OBJECT ${parse_secret_files})
954endif()
955
956add_subdirectory(client)
957
958if(WITH_LIBCEPHFS)
959 set(libcephfs_srcs libcephfs.cc)
960 add_library(cephfs ${CEPH_SHARED} ${libcephfs_srcs})
961 target_link_libraries(cephfs LINK_PRIVATE client ceph-common
962 ${CRYPTO_LIBS} ${EXTRALIBS})
963 if(ENABLE_SHARED)
964 foreach(name ceph-common client osdc)
965 set(CEPHFS_LINK_FLAGS "${CEPHFS_LINK_FLAGS} -Wl,--exclude-libs,lib${name}.a")
966 endforeach()
967 set_target_properties(cephfs PROPERTIES
968 OUTPUT_NAME cephfs
969 VERSION 2.0.0
970 SOVERSION 2
971 LINK_FLAGS ${CEPHFS_LINK_FLAGS})
972 endif(ENABLE_SHARED)
973 install(TARGETS cephfs DESTINATION ${CMAKE_INSTALL_LIBDIR})
974 install(DIRECTORY
975 "${CMAKE_SOURCE_DIR}/src/include/cephfs"
976 DESTINATION include)
977 set(ceph_syn_srcs
978 ceph_syn.cc
979 client/SyntheticClient.cc)
980 add_executable(ceph-syn ${ceph_syn_srcs})
981 target_link_libraries(ceph-syn client global-static common)
982
983 set(mount_ceph_srcs
984 mount/mount.ceph.c)
985 add_executable(mount.ceph ${mount_ceph_srcs}
986 $<TARGET_OBJECTS:parse_secret_objs>
987 $<TARGET_OBJECTS:common_mountcephfs_objs>)
988 set_target_properties(mount.ceph PROPERTIES
989 INSTALL_RPATH "")
990 target_link_libraries(mount.ceph ${KEYUTILS_LIBRARIES})
991
992 install(TARGETS ceph-syn DESTINATION bin)
993 install(TARGETS mount.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR})
994endif(WITH_LIBCEPHFS)
995
996if(WITH_FUSE)
997 set(ceph_fuse_srcs
998 ceph_fuse.cc
999 client/fuse_ll.cc)
1000 add_executable(ceph-fuse ${ceph_fuse_srcs})
1001 target_link_libraries(ceph-fuse ${ALLOC_LIBS} ${FUSE_LIBRARIES}
1002 client common global-static)
1003 set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}")
1004 install(TARGETS ceph-fuse DESTINATION bin)
1005 install(PROGRAMS mount.fuse.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR})
1006endif(WITH_FUSE)
1007
1008add_subdirectory(journal)
1009
1010if(WITH_RBD)
1011 if(WITH_KRBD)
1012 add_library(krbd STATIC krbd.cc
1013 $<TARGET_OBJECTS:parse_secret_objs>)
1014 target_link_libraries(krbd ${KEYUTILS_LIBRARIES} ${UDEV_LIBRARIES})
1015 endif()
1016 add_subdirectory(librbd)
1017 if(WITH_FUSE)
1018 add_subdirectory(rbd_fuse)
1019 endif()
1020
1021 install(PROGRAMS
1022 ${CMAKE_SOURCE_DIR}/src/ceph-rbdnamer
1023 ${CMAKE_SOURCE_DIR}/src/rbd-replay-many
1024 ${CMAKE_SOURCE_DIR}/src/rbdmap
1025 DESTINATION ${CMAKE_INSTALL_BINDIR})
1026 add_subdirectory(rbd_replay)
1027endif(WITH_RBD)
1028
1029# RadosGW
1030if(WITH_KVS)
1031 add_subdirectory(key_value_store)
1032endif(WITH_KVS)
1033
1034if(WITH_RADOSGW)
1035 set(civetweb_common_files civetweb/src/civetweb.c)
1036 add_library(civetweb_common_objs OBJECT ${civetweb_common_files})
1037 target_include_directories(civetweb_common_objs PRIVATE
1038 "${CMAKE_SOURCE_DIR}/src/civetweb/include")
1039 set_property(TARGET civetweb_common_objs
1040 APPEND PROPERTY COMPILE_DEFINITIONS USE_IPV6=1)
1041 if(USE_OPENSSL)
1042 set_property(TARGET civetweb_common_objs
1043 APPEND PROPERTY COMPILE_DEFINITIONS NO_SSL_DL=1)
1044 target_include_directories(civetweb_common_objs PRIVATE
1045 "${SSL_INCLUDE_DIR}")
1046 endif(USE_OPENSSL)
1047 if (LIBSSL_SONAME)
1048 set_property(TARGET civetweb_common_objs
1049 APPEND PROPERTY COMPILE_DEFINITIONS SSL_LIB="${LIBSSL_SONAME}")
1050 set_property(TARGET civetweb_common_objs
1051 APPEND PROPERTY COMPILE_DEFINITIONS CRYPTO_LIB="${LIBCRYPTO_SONAME}")
1052 endif()
1053
1054 add_subdirectory(rgw)
1055
1056endif(WITH_RADOSGW)
1057
1058install(FILES
1059 sample.ceph.conf
1060 DESTINATION ${CMAKE_INSTALL_DOCDIR})
1061install(FILES
1062 fetch_config
1063 DESTINATION ${CMAKE_INSTALL_DOCDIR}
1064 RENAME sample.fetch_config)
1065
1066# Now create a useable config.h
1067configure_file(
1068 ${CMAKE_SOURCE_DIR}/src/include/config-h.in.cmake
1069 ${CMAKE_BINARY_DIR}/include/acconfig.h
1070)
1071
1072add_subdirectory(brag)
1073
1074# Everything you need to spin up a cluster with vstart.sh
1075add_custom_target(vstart-base DEPENDS
1076 ceph-osd
1077 ceph-mon
1078 ceph-mgr
1079 ceph-authtool
1080 ceph-conf
1081 monmaptool
1082 crushtool
1083 rados
1084 cython_rados
1085 )
1086
1087add_custom_target(vstart DEPENDS
1088 vstart-base
1089 ceph-mds)
1090if(WITH_RADOSGW)
1091 add_dependencies(vstart radosgw radosgw-admin)
1092endif(WITH_RADOSGW)
1093
1094if(WITH_LTTNG)
1095 add_dependencies(vstart tracepoint_libraries)
1096endif(WITH_LTTNG)
1097
1098# Everything you need to run CephFS tests
1099add_custom_target(cephfs_testing DEPENDS
1100 vstart
1101 rados
1102 cython_modules
1103 cephfs
1104 cls_cephfs
1105 ceph-fuse
1106 ceph-dencoder
1107 cephfs-journal-tool
1108 cephfs-data-scan
1109 cephfs-table-tool)
1110
1111if (IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git")
1112 add_custom_target(
1113 git-update
1114 COMMAND git submodule sync
1115 COMMAND git submodule update --force --init --recursive
1116 WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")
1117endif()
1118
1119add_subdirectory(script)
1120
1121if(WITH_EMBEDDED)
1122 add_subdirectory(libcephd)
1123endif()