ws
[m6w6/libmemcached] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.9...3.18)
2
3 if(${CMAKE_VERSION} VERSION_LESS 3.12)
4 cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
5 endif()
6
7 include(CMakeVersions.txt)
8
9 project(libmemcached
10 VERSION "${LIBMEMCACHED_VERSION}"
11 DESCRIPTION "libmemcached https://github.com/m6w6/libmemcached"
12 )
13
14 set(CMAKE_CXX_STANDARD 11)
15 set(CMAKE_CXX_STANDARD_REQUIRED ON)
16 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
17
18 include(CMakeConfig.txt)
19
20 if(NOT BUILD_DOCSONLY)
21
22 set(AUTOHEADER_FILE mem_config.h)
23
24 set(CLIENTS
25 memcapable
26 memcat
27 memcp
28 memdump
29 memerror
30 memexist
31 memflush
32 memparse
33 memping
34 memrm
35 memslap
36 memstat
37 memtouch
38 )
39
40 add_subdirectory(include)
41 add_subdirectory(src)
42 add_subdirectory(support)
43 add_subdirectory(test)
44
45 # keep last
46 configure_file(src/mem_config.h.in ${AUTOHEADER_FILE} @ONLY)
47 endif()
48
49 if(BUILD_DOCS OR BUILD_DOCSONLY)
50 add_subdirectory(docs)
51 endif()
52
53 if(ENV{INVALID_CONFIGURATION})
54 message(FATAL_ERROR "invalid configuration -- giving up")
55 endif()