cmake: add libmemcachedprotocol to build
authorMichael Wallner <mike@php.net>
Tue, 18 Aug 2020 07:31:00 +0000 (09:31 +0200)
committerMichael Wallner <mike@php.net>
Tue, 18 Aug 2020 07:31:00 +0000 (09:31 +0200)
CMakeVersions.txt
include/CMakeLists.txt
include/libmemcachedprotocol-0.0/CMakeLists.txt [new file with mode: 0644]
src/CMakeLists.txt
src/libmemcachedprotocol/CMakeLists.txt [new file with mode: 0644]

index 8f689ee2ae9f35b976e790e08ad1c921dcdeb603..4917c947afd5f4e4e669f4c7cf457842d15f9ef5 100644 (file)
@@ -14,38 +14,80 @@ function(to_hex HEX)
     set(${HEX} ${XNUMBER} PARENT_SCOPE)
 endfunction()
 
+#
+# libmemcached
+#
+
 set(LIBMEMCACHED_VERSION_MAJOR 1)
 set(LIBMEMCACHED_VERSION_MINOR 0)
 set(LIBMEMCACHED_VERSION_PATCH 99)
 
 set(LIBMEMCACHED_VERSION ${LIBMEMCACHED_VERSION_MAJOR}.${LIBMEMCACHED_VERSION_MINOR}.${LIBMEMCACHED_VERSION_PATCH})
+set(LIBMEMCACHED_VERSION_INC ${LIBMEMCACHED_VERSION_MAJOR}.${LIBMEMCACHED_VERSION_MINOR})
 to_hex(LIBMEMCACHED_VERSION_HEX ${LIBMEMCACHED_VERSION_MAJOR} ${LIBMEMCACHED_VERSION_MINOR} ${LIBMEMCACHED_VERSION_PATCH})
 
+# libmemcached.so
+
 set(LIBMEMCACHED_SO_VERSION_CUR 12)
 set(LIBMEMCACHED_SO_VERSION_REV 0)
 set(LIBMEMCACHED_SO_VERSION_AGE 0)
 
 set(LIBMEMCACHED_SO_VERSION ${LIBMEMCACHED_SO_VERSION_CUR}.${LIBMEMCACHED_SO_VERSION_REV}.${LIBMEMCACHED_SO_VERSION_AGE})
 
+#
+# libmemcachedutil
+#
+
+set(LIBMEMCACHEDUTIL_VERSION_MAJOR 1)
+set(LIBMEMCACHEDUTIL_VERSION_MINOR 0)
+set(LIBMEMCACHEDUTIL_VERSION_PATCH 0)
+
+set(LIBMEMCACHEDUTIL_VERSION ${LIBMEMCACHEDUTIL_VERSION_MAJOR}.${LIBMEMCACHEDUTIL_VERSION_MINOR}.${LIBMEMCACHEDUTIL_VERSION_PATCH})
+set(LIBMEMCACHEDUTIL_VERSION_INC ${LIBMEMCACHEDUTIL_VERSION_MAJOR}.${LIBMEMCACHEDUTIL_VERSION_MINOR})
+to_hex(LIBMEMCACHEDUTIL_VERSION_HEX ${LIBMEMCACHEDUTIL_VERSION_MAJOR} ${LIBMEMCACHEDUTIL_VERSION_MINOR} ${LIBMEMCACHEDUTIL_VERSION_PATCH})
+
+# libmemcachedutil.so
+
 set(LIBMEMCACHEDUTIL_SO_VERSION_CUR 2)
 set(LIBMEMCACHEDUTIL_SO_VERSION_REV 0)
 set(LIBMEMCACHEDUTIL_SO_VERSION_AGE 0)
 
 set(LIBMEMCACHEDUTIL_SO_VERSION ${LIBMEMCACHEDUTIL_SO_VERSION_CUR}.${LIBMEMCACHEDUTIL_SO_VERSION_REV}.${LIBMEMCACHEDUTIL_SO_VERSION_AGE})
 
+#
+# libmemcachedprotocol
+#
+
+set(LIBMEMCACHEDPROTOCOL_VERSION_MAJOR 0)
+set(LIBMEMCACHEDPROTOCOL_VERSION_MINOR 0)
+set(LIBMEMCACHEDPROTOCOL_VERSION_PATCH 0)
+
+set(LIBMEMCACHEDPROTOCOL_VERSION ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR}.${LIBMEMCACHEDPROTOCOL_VERSION_MINOR}.${LIBMEMCACHEDPROTOCOL_VERSION_PATCH})
+set(LIBMEMCACHEDPROTOCOL_VERSION_INC ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR}.${LIBMEMCACHEDPROTOCOL_VERSION_MINOR})
+to_hex(LIBMEMCACHEDPROTOCOL_VERSION_HEX ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR} ${LIBMEMCACHEDPROTOCOL_VERSION_MINOR} ${LIBMEMCACHEDPROTOCOL_VERSION_PATCH})
+
+# libmemcachedprotocol.so
+
 set(LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR 0)
 set(LIBMEMCACHEDPROTOCOL_SO_VERSION_REV 0)
 set(LIBMEMCACHEDPROTOCOL_SO_VERSION_AGE 0)
 
 set(LIBMEMCACHEDPROTOCOL_SO_VERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION_CUR}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_REV}.${LIBMEMCACHEDPROTOCOL_SO_VERSION_AGE})
 
+#
+# libhashkit
+#
+
 set(LIBHASHKIT_VERSION_MAJOR 1)
 set(LIBHASHKIT_VERSION_MINOR 0)
 set(LIBHASHKIT_VERSION_PATCH 0)
 
 set(LIBHASHKIT_VERSION ${LIBHASHKIT_VERSION_MAJOR}.${LIBHASHKIT_VERSION_MINOR}.${LIBHASHKIT_VERSION_PATCH})
+set(LIBHASHKIT_VERSION_INC ${LIBHASHKIT_VERSION_MAJOR}.${LIBHASHKIT_VERSION_MINOR})
 to_hex(LIBHASHKIT_VERSION_HEX ${LIBHASHKIT_VERSION_MAJOR} ${LIBHASHKIT_VERSION_MINOR} ${LIBHASHKIT_VERSION_PATCH})
 
+# libhashkit.so
+
 set(LIBHASHKIT_SO_VERSION_CUR 2)
 set(LIBHASHKIT_SO_VERSION_REV 0)
 set(LIBHASHKIT_SO_VERSION_AGE 0)
index 90825091e8042a9b3ff98e4744663bee3552b3bf..bc3dadc5323a5dffb3dd48289dde5760cd6faad2 100644 (file)
@@ -2,3 +2,4 @@
 add_subdirectory(libhashkit-1.0)
 add_subdirectory(libmemcached-1.0)
 add_subdirectory(libmemcachedutil-1.0)
+add_subdirectory(libmemcachedprotocol-0.0)
diff --git a/include/libmemcachedprotocol-0.0/CMakeLists.txt b/include/libmemcachedprotocol-0.0/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6d4fb22
--- /dev/null
@@ -0,0 +1,9 @@
+
+install_public_headers(
+        libmemcachedprotocol-0.0
+
+        binary.h
+        callback.h
+        handler.h
+        vbucket.h
+)
index 10699115dfde528111b7a84d81833d3601f99ca2..f508ec0448127446e012d8d98215871c9196650f 100644 (file)
@@ -3,6 +3,7 @@ add_subdirectory(bin)
 add_subdirectory(libhashkit)
 add_subdirectory(libmemcached)
 add_subdirectory(libmemcachedutil)
+add_subdirectory(libmemcachedprotocol)
 
 if(BUILD_TESTING)
     add_subdirectory(libtest)
diff --git a/src/libmemcachedprotocol/CMakeLists.txt b/src/libmemcachedprotocol/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3712cf4
--- /dev/null
@@ -0,0 +1,19 @@
+
+add_library(libmemcachedprotocol SHARED
+        ascii_handler.c
+        binary_handler.c
+        cache.c
+        common.h
+        handler.c
+        pedantic.c
+        )
+add_library(memcachedprotocol ALIAS libmemcachedprotocol)
+set_target_properties(libmemcachedprotocol PROPERTIES LIBRARY_OUTPUT_NAME memcachedprotocol)
+target_compile_definitions(libmemcachedprotocol PRIVATE -DBUILDING_LIBMEMCACHED)
+target_link_libraries(libmemcachedprotocol libmemcached Threads::Threads)
+
+set_target_properties(libmemcachedprotocol PROPERTIES SOVERSION ${LIBMEMCACHEDPROTOCOL_SO_VERSION})
+install(TARGETS libmemcachedprotocol EXPORT libmemcachedprotocol
+        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+export(EXPORT libmemcachedprotocol)
+install(EXPORT libmemcachedprotocol DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake)