From b331898ea9aefc547265b388dddbc388417184fe Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Fri, 26 May 2017 11:58:14 +0200 Subject: [PATCH] CMakeLists.txt: Rewrite 2 remaning options to WITH_ All options to en/disable inclusion of libraries or other software are of the format WITH_ so that the Cmake commaind like ahs all WITH_* options. The WITH_=ON option will result in a HAVE_ setting in CMAKE so that tests can use that variable. Last "abusers" to actually follow this format. - HAVE_BABELTRACE - HAVE_ZFSLIB is fixed in #15907 Signed-off-by: Willem Jan Withagen --- CMakeLists.txt | 8 ++++---- ceph.spec.in | 4 ++-- src/rbd_replay/CMakeLists.txt | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f0dab6f82d..2cfd6b7921c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -453,14 +453,14 @@ endif(${WITH_LTTNG}) option(WITH_OSD_INSTRUMENT_FUNCTIONS OFF) #option for Babeltrace -option(HAVE_BABELTRACE "Babeltrace libraries are enabled" ON) -if(${HAVE_BABELTRACE}) +option(WITH_BABELTRACE "Babeltrace libraries are enabled" ON) +if(WITH_BABELTRACE) + set(HAVE_BABELTRACE ON) find_package(babeltrace REQUIRED) - set(WITH_BABELTRACE ${BABELTRACE_FOUND}) set(HAVE_BABELTRACE_BABELTRACE_H ${BABELTRACE_FOUND}) set(HAVE_BABELTRACE_CTF_EVENTS_H ${BABELTRACE_FOUND}) set(HAVE_BABELTRACE_CTF_ITERATOR_H ${BABELTRACE_FOUND}) -endif(${HAVE_BABELTRACE}) +endif(WITH_BABELTRACE) option(DEBUG_GATHER "C_Gather debugging is enabled" ON) option(HAVE_LIBZFS "LibZFS is enabled" OFF) diff --git a/ceph.spec.in b/ceph.spec.in index 54fe4b319f6..2abd91a2575 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -836,10 +836,10 @@ cmake .. \ %endif %if %{with lttng} -DWITH_LTTNG=ON \ - -DHAVE_BABELTRACE=ON \ + -DWTIH_BABELTRACE=ON \ %else -DWITH_LTTNG=OFF \ - -DHAVE_BABELTRACE=OFF \ + -DWTIH_BABELTRACE=OFF \ %endif $CEPH_EXTRA_CMAKE_ARGS \ %if 0%{with ocf} diff --git a/src/rbd_replay/CMakeLists.txt b/src/rbd_replay/CMakeLists.txt index 100a3ab861b..2e2e176d80b 100644 --- a/src/rbd_replay/CMakeLists.txt +++ b/src/rbd_replay/CMakeLists.txt @@ -23,7 +23,7 @@ set(librbd_replay_ios_srcs add_library(rbd_replay_ios STATIC ${librbd_replay_ios_srcs}) target_link_libraries(rbd_replay_ios librbd librados global) -if(${WITH_BABELTRACE}) +if(HAVE_BABELTRACE) add_executable(rbd-replay-prep rbd-replay-prep.cc) target_link_libraries(rbd-replay-prep @@ -39,4 +39,5 @@ if(${WITH_BABELTRACE}) Boost::date_time ) install(TARGETS rbd-replay-prep DESTINATION bin) -endif(${WITH_BABELTRACE}) +endif(HAVE_BABELTRACE) + -- 2.39.5