1 cmake_minimum_required(VERSION 3.9...3.18)
3 if(${CMAKE_VERSION} VERSION_LESS 3.12)
4 cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
7 include(CMakeVersions.txt)
10 VERSION "${LIBMEMCACHED_VERSION}"
11 DESCRIPTION "libmemcached https://github.com/m6w6/libmemcached"
14 set(CMAKE_CXX_STANDARD 11)
15 set(CMAKE_CXX_STANDARD_REQUIRED ON)
16 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
18 include(CMakeConfig.txt)
20 if(NOT BUILD_DOCSONLY)
22 set(AUTOHEADER_FILE mem_config.h)
40 add_subdirectory(include)
42 add_subdirectory(support)
43 add_subdirectory(test)
46 configure_file(src/mem_config.h.in ${AUTOHEADER_FILE} @ONLY)
49 if(BUILD_DOCS OR BUILD_DOCSONLY)
50 add_subdirectory(docs)
53 if(ENV{INVALID_CONFIGURATION})
54 message(FATAL_ERROR "invalid configuration -- giving up")