cmake: compat with <3.12
authorMichael Wallner <mike@php.net>
Mon, 14 Dec 2020 16:38:56 +0000 (17:38 +0100)
committerMichael Wallner <mike@php.net>
Mon, 14 Dec 2020 16:38:56 +0000 (17:38 +0100)
CMake/_Include.cmake
CMakeConfig.txt
CMakeLists.txt
src/libhashkit/CMakeLists.txt
src/libmemcached/CMakeLists.txt
src/libmemcachedprotocol/CMakeLists.txt
src/libmemcachedutil/CMakeLists.txt

index 39442dc2901cfc5cd8b6499d85a0de5f64e06088..90ebc261b471b98ad893a62bc44d3219ef7132b0 100644 (file)
@@ -1,3 +1,5 @@
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
+
 include(_Configure)
 configure_init(${CMAKE_BINARY_DIR}/mem_config.h)
 
index 377c03ad8314e9c924b50e5d95c4fd14c980ce0d..5203ddac357b4b171529a728f291fae856db2749 100644 (file)
@@ -17,6 +17,12 @@ elseif(UNIX)
         CACHE STRING "set relative rpath")
 endif()
 
+if(${CMAKE_VERSION} VERSION_LESS "3.12")
+    set(TARGET_NAMELINK_COMPONENT "")
+else()
+    set(TARGET_NAMELINK_COMPONENT NAMELINK_COMPONENT dev)
+endif()
+
 option(BUILD_TESTING        "whether to enable build of the test suite"
         $ENV{BUILD_TESTING})
 option(BUILD_DOCSONLY       "build *only* documentation"
@@ -79,13 +85,3 @@ if(BUILD_DOCS)
     set(SPHINX_CONF_APPEND ""
         CACHE STRING "append verbatim code to sphinx' conf.py")
 endif()
-
-# modules
-
-include(GNUInstallDirs)
-
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
-
-if(NOT BUILD_DOCSONLY)
-    include(CMake/_Include.cmake)
-endif()
index c32fedae0137b7bed7118204cc197e3c1fcf8bea..48fc3298bc51d1a6209d18b5cb352e7d627160c9 100644 (file)
@@ -8,21 +8,23 @@ include(CMakeVersions.txt)
 
 project(libmemcached
         VERSION "${LIBMEMCACHED_VERSION}"
-        HOMEPAGE_URL "https://github.com/m6w6/libmemcached"
         DESCRIPTION "libmemcached, a C/C++ memcached client library"
         )
+set(CMAKE_PROJECT_HOMEPAGE_URL "https://github.com/m6w6/libmemcached")
 set(PROJECT_CONTACT "Michael Wallner <mike@php.net>")
 
 set(CXX_STANDARD 11)
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
 include(CMakeConfig.txt)
+include(GNUInstallDirs)
 
 if(BUILD_DOCS OR BUILD_DOCSONLY)
     add_subdirectory(docs)
 endif()
 
 if(NOT BUILD_DOCSONLY)
+    include(CMake/_Include.cmake)
 
     set(CLIENTS
             memcapable
index 06b0c31510acf4494f59ef3506f8ef1298b302b4..1a03de2365f25a72eafa7882d913be7352b974d7 100644 (file)
@@ -42,7 +42,7 @@ configure_file(hashkitcon.h.in hashkitcon.h @ONLY)
 install(TARGETS libhashkit EXPORT libhashkit-targets
         LIBRARY
         COMPONENT lib
-        NAMELINK_COMPONENT dev
+        ${TARGET_NAMELINK_COMPONENT}
         DESTINATION ${CMAKE_INSTALL_LIBDIR})
 export(EXPORT libhashkit-targets NAMESPACE libmemcached::)
 install(EXPORT libhashkit-targets NAMESPACE libmemcached::
index c3d5389312568cbf733802318d9f8fc84f42111b..a6de76b771509fa8f826b6dc675f8327ff956f43 100644 (file)
@@ -122,7 +122,7 @@ enable_dtrace_for(libmemcached libmemcached_probes.d dtrace_probes.h)
 install(TARGETS libmemcached EXPORT libmemcached-targets
         LIBRARY
         COMPONENT lib
-        NAMELINK_COMPONENT dev
+        ${TARGET_NAMELINK_COMPONENT}
         DESTINATION ${CMAKE_INSTALL_LIBDIR})
 export(EXPORT libmemcached-targets NAMESPACE libmemcached::)
 install(EXPORT libmemcached-targets NAMESPACE libmemcached::
index fc0315654ad5089519b07fbcacc9d3a8e9cce0ae..2add5133ec9dda3ce6f3bf93f8783a03cbff85c3 100644 (file)
@@ -38,7 +38,7 @@ target_include_directories(libmemcachedprotocol PUBLIC
 install(TARGETS libmemcachedprotocol EXPORT libmemcachedprotocol-targets
         LIBRARY
         COMPONENT lib
-        NAMELINK_COMPONENT dev
+        ${TARGET_NAMELINK_COMPONENT}
         DESTINATION ${CMAKE_INSTALL_LIBDIR})
 export(EXPORT libmemcachedprotocol-targets NAMESPACE libmemcached::)
 install(EXPORT libmemcachedprotocol-targets NAMESPACE libmemcached::
index af2562cd9ac89a6bc3618126c5367175fc94b6ff..f1b33fb6fac4af72a4601347c78a5f555c83550c 100644 (file)
@@ -43,7 +43,7 @@ target_include_directories(libmemcachedutil PUBLIC
 install(TARGETS libmemcachedutil EXPORT libmemcachedutil-targets
         LIBRARY
         COMPONENT lib
-        NAMELINK_COMPONENT dev
+        ${TARGET_NAMELINK_COMPONENT}
         DESTINATION ${CMAKE_INSTALL_LIBDIR})
 export(EXPORT libmemcachedutil-targets NAMESPACE libmemcached::)
 install(EXPORT libmemcachedutil-targets NAMESPACE libmemcached::