tests: investigating catch2
[awesomized/libmemcached] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.9..3.16)
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 foreach(INCLUDE IN ITEMS ${CMAKE_BINARY_DIR} .)
22 include_directories(
23 ${INCLUDE}/
24 ${INCLUDE}/include
25 ${INCLUDE}/src
26 )
27 endforeach()
28
29 set(AUTOHEADER_FILE mem_config.h)
30
31 set(CLIENTS
32 memcapable
33 memcat
34 memcp
35 memdump
36 memerror
37 memexist
38 memflush
39 memparse
40 memping
41 memrm
42 memslap
43 memstat
44 memtouch
45 )
46
47 add_subdirectory(include)
48 add_subdirectory(src)
49 add_subdirectory(support)
50
51 if(BUILD_TESTING)
52 add_subdirectory(testing)
53 add_subdirectory(tests)
54 endif()
55
56 # keep last
57 configure_file(src/mem_config.h.in ${AUTOHEADER_FILE} @ONLY)
58 endif()
59
60 if(BUILD_DOCS OR BUILD_DOCSONLY)
61 add_subdirectory(docs)
62 endif()
63
64 if(ENV{INVALID_CONFIGURATION})
65 message(FATAL_ERROR "invalid configuration -- giving up")
66 endif()