From af2c91ace6c1082925f118d145937ae55fa780d4 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 6 Jul 2018 13:25:23 +0800 Subject: [PATCH] deb,rpm,do_cmake: switch to cmake3 Signed-off-by: Kefu Chai --- ceph.spec.in | 13 +++++++++++-- debian/control | 2 +- do_cmake.sh | 7 ++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index 1891248c5c99..07553ac358dd 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -120,7 +120,11 @@ BuildRequires: selinux-policy-devel %endif BuildRequires: bc BuildRequires: gperf -BuildRequires: cmake +%if 0%{?rhel} == 7 +BuildRequires: cmake3 > 3.5 +%else +BuildRequires: cmake > 3.5 +%endif BuildRequires: cryptsetup BuildRequires: fuse-devel %if 0%{?rhel} == 7 @@ -892,7 +896,12 @@ env | sort mkdir build cd build -cmake .. \ +%if 0%{?rhel} == 7 +CMAKE=cmake3 +%else +CMAKE=cmake +%endif +${CMAKE} .. \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ -DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \ diff --git a/debian/control b/debian/control index e394b6fed0fd..dc214f9e9ce2 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Uploaders: Ken Dreyer , Alfredo Deza , Build-Depends: bc, btrfs-tools, - cmake, + cmake (>= 3.5), cpio, cryptsetup-bin | cryptsetup, cython, diff --git a/do_cmake.sh b/do_cmake.sh index b2d7594ae91f..c7599859bc80 100755 --- a/do_cmake.sh +++ b/do_cmake.sh @@ -13,7 +13,12 @@ fi mkdir build cd build NPROC=${NPROC:-$(nproc)} -cmake -DBOOST_J=$NPROC $ARGS "$@" .. +if type cmake3 > /dev/null 2>&1 ; then + CMAKE=cmake3 +else + CMAKE=cmake +fi +${CMAKE} -DBOOST_J=$NPROC $ARGS "$@" .. # minimal config to find plugins cat < ceph.conf -- 2.47.3