From ce191414e28ebf247d77727219b634bc5507c34a 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 (cherry picked from commit af2c91ace6c1082925f118d145937ae55fa780d4) --- 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 bc08fecb2eaf2..fe2f10e56d443 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -126,7 +126,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 @@ -899,7 +903,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 adcd5397ce3c9..39c6ebb04412a 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 b2d7594ae91fd..c7599859bc80b 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