-cmake_minimum_required(VERSION 3.5.1)
+cmake_minimum_required(VERSION 3.10.2)
# remove cmake/modules/FindPython* once 3.12 is required
-project(ceph CXX C ASM)
-set(VERSION 15.0.0)
+project(ceph
+ VERSION 15.0.0
+ LANGUAGES CXX C ASM)
if(POLICY CMP0028)
cmake_policy(SET CMP0028 NEW)
if(POLICY CMP0046)
cmake_policy(SET CMP0046 NEW)
endif()
+if(POLICY CMP0048)
+ cmake_policy(SET CMP0048 NEW)
+endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
# Contributor: John Coyle <dx9err@gmail.com>
# Maintainer: John Coyle <dx9err@gmail.com>
pkgname=ceph
-pkgver=@VERSION@
+pkgver=@PROJECT_VERSION@
pkgrel=@RPM_RELEASE@
pkgdesc="Ceph is a distributed object store and file system"
pkgusers="ceph"
# main package definition
#################################################################################
Name: ceph
-Version: @VERSION@
+Version: @PROJECT_VERSION@
Release: @RPM_RELEASE@%{?dist}
%if 0%{?fedora} || 0%{?rhel}
Epoch: 2
${CMAKE_CURRENT_LIST_DIR}/FindStdFilesystem_test.cc)
macro(try_std_filesystem_library _library _result)
- if(CMAKE_VERSION VERSION_LESS "3.8")
- # abuse the definition flags, because they are quite
- # the same as CMAKE_C_FLAGS: they are passed to the
- # compiler.
- set(_std_filesystem_try_compile_arg
- COMPILE_DEFINITIONS "-std=c++17")
- else()
- set(_std_filesystem_try_compile_arg
- CXX_STANDARD 17)
- endif()
+ set(_std_filesystem_try_compile_arg
+ CXX_STANDARD 17)
try_compile(_std_filesystem_compiles
${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${_std_filesystem_test_src}
for spec in ceph.spec.in alpine/APKBUILD.in; do
cat $spec |
- sed "s/@VERSION@/$rpm_version/g" |
+ sed "s/@PROJECT_VERSION@/$rpm_version/g" |
sed "s/@RPM_RELEASE@/$rpm_release/g" |
sed "s/@TARBALL_BASENAME@/ceph-$version/g" > `echo $spec | sed 's/.in$//'`
done
# require c++17
-if(CMAKE_VERSION VERSION_LESS "3.8")
- CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
- if(NOT COMPILER_SUPPORTS_CXX17)
- message(FATAL_ERROR
- "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support.")
- endif()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
-
- # for compiletest_cxx11_client
- CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
- if(NOT COMPILER_SUPPORTS_CXX11)
- message(FATAL_ERROR
- "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
- endif()
-
- include(CheckCCompilerFlag)
- CHECK_C_COMPILER_FLAG("-std=gnu99" COMPILER_SUPPORTS_GNU99)
- if(NOT COMPILER_SUPPORTS_GNU99)
- message(FATAL_ERROR
- "The compiler ${CMAKE_C_COMPILER} has no GNU C99 support.")
- endif()
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
-else()
- set(CMAKE_CXX_STANDARD 17)
- set(CMAKE_CXX_EXTENSIONS OFF)
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
- set(CMAKE_C_STANDARD 99)
- # we use `asm()` to inline assembly, so enable the GNU extension
- set(CMAKE_C_EXTENSIONS ON)
- set(C_STANDARD_REQUIRED ON)
-endif()
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_EXTENSIONS OFF)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_C_STANDARD 99)
+# we use `asm()` to inline assembly, so enable the GNU extension
+set(CMAKE_C_EXTENSIONS ON)
+set(C_STANDARD_REQUIRED ON)
include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("
#cmakedefine HAVE_STATIC_CAST
/* Version number of package */
-#cmakedefine VERSION "@VERSION@"
+#cmakedefine PROJECT_VERSION "@PROJECT_VERSION@"
/* Defined if pthread_setname_np() is available */
#cmakedefine HAVE_PTHREAD_SETNAME_NP 1
*pminor = (n >= 2) ? minor : 0;
if (ppatch)
*ppatch = (n >= 3) ? patch : 0;
- return VERSION;
+ return PROJECT_VERSION;
}
extern "C" int ceph_create_with_context(struct ceph_mount_info **cmount, CephContext *cct)