From: Michael Wallner Date: Tue, 18 Aug 2020 07:31:00 +0000 (+0200) Subject: cmake: add libmemcachedprotocol to build X-Git-Tag: 1.1.0-beta1~244 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=64cb7f342f590fa8fe3376eb7562ee73e4dc75f2;p=m6w6%2Flibmemcached cmake: add libmemcachedprotocol to build --- diff --git a/CMakeVersions.txt b/CMakeVersions.txt index 8f689ee2..4917c947 100644 --- a/CMakeVersions.txt +++ b/CMakeVersions.txt @@ -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) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 90825091..bc3dadc5 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -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 index 00000000..6d4fb220 --- /dev/null +++ b/include/libmemcachedprotocol-0.0/CMakeLists.txt @@ -0,0 +1,9 @@ + +install_public_headers( + libmemcachedprotocol-0.0 + + binary.h + callback.h + handler.h + vbucket.h +) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 10699115..f508ec04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 index 00000000..3712cf44 --- /dev/null +++ b/src/libmemcachedprotocol/CMakeLists.txt @@ -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)