X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=CMakeLists.txt;h=1396a42a587a35afee82ca9ab37c4caa283260ea;hb=refs%2Fheads%2Fv1.x;hp=1f12aaca80600960f630c5929b3f7ba070b2c9a1;hpb=cbec7a4b9613b8ae3807539fae3a29ed8aff4984;p=awesomized%2Flibmemcached diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f12aaca..1396a42a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9..3.16) +cmake_minimum_required(VERSION 3.9...3.18) if(${CMAKE_VERSION} VERSION_LESS 3.12) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) @@ -6,51 +6,88 @@ endif() include(CMakeVersions.txt) -project(libmemcached +project(libmemcached-awesome VERSION "${LIBMEMCACHED_VERSION}" - DESCRIPTION "libmemcached https://github.com/m6w6/libmemcached" + DESCRIPTION "libmemcached-awesome, a C/C++ memcached client library" ) +set(PROJECT_HOMEPAGE_URL "https://github.com/awesomized/libmemcached") +set(PROJECT_CONTACT "Michael Wallner ") -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CXX_STANDARD 11) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(GLOBAL_DEFINITIONS _GNU_SOURCE) + include(CMakeConfig.txt) +include(GNUInstallDirs) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") -include_directories(${CMAKE_BINARY_DIR}) -set(AUTOHEADER_FILE mem_config.h) - -set(CLIENTS - memcapable - memcat - memcp - memdump - memerror - memexist - memflush - memparse - memping - memrm - memslap - memstat - memtouch - ) +if(BUILD_DOCS OR BUILD_DOCSONLY) + add_subdirectory(docs) +endif() + +if(NOT BUILD_DOCSONLY) + include(CMake/_Include.cmake) + + set(CLIENTS + capable + cat + cp + dump + error + exist + flush + parse + ping + rm + slap + stat + touch + ) + + add_subdirectory(include) + add_subdirectory(src) + add_subdirectory(contrib) + add_subdirectory(support) -add_subdirectory(clients) -add_subdirectory(libhashkit) -add_subdirectory(libhashkit-1.0) -add_subdirectory(libmemcached) -add_subdirectory(libmemcached-1.0) -add_subdirectory(libmemcachedutil) -add_subdirectory(libmemcachedutil-1.0) - -if(BUILD_TESTING) - add_subdirectory(libtest) - add_subdirectory(tests) + # tests need c++17 support + add_subdirectory(test) + + # keep last + configure_file(${CONFIGURE_FILE_IN} ${CONFIGURE_FILE_OUT} @ONLY) endif() -add_subdirectory(docs) -add_subdirectory(support) +list(APPEND PROJECT_CONFIG ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}) +list(APPEND PROJECT_CONFIG ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}) +list(APPEND PROJECT_CONFIG ${CMAKE_BUILD_TYPE}) + +include(CPack.txt) + +install(FILES + AUTHORS + BUGS.md + ChangeLog-0.md + ChangeLog-1.0.md + ChangeLog-1.1.md + CONTRIBUTING.md + LICENSE + NEWS + README.md + TODO + COMPONENT doc + DESTINATION ${CMAKE_INSTALL_DOCDIR}/ + ) +if(NOT WIN32) + # skip links on windows (cmake bug?) + install(FILES + ChangeLog + ChangeLog.md + COPYING + COMPONENT doc + DESTINATION ${CMAKE_INSTALL_DOCDIR}/ + ) +endif() -# keep last -configure_file(mem_config.h.in ${CMAKE_BINARY_DIR}/${AUTOHEADER_FILE} @ONLY) +if(ENV{INVALID_CONFIGURATION}) + message(FATAL_ERROR "invalid configuration -- giving up") +endif()