cmake: simplify version config
authorMichael Wallner <mike@php.net>
Sun, 27 Dec 2020 17:15:01 +0000 (18:15 +0100)
committerMichael Wallner <mike@php.net>
Mon, 28 Dec 2020 12:31:23 +0000 (13:31 +0100)
CMakeVersions.txt

index 5688a61e29405d5c7711d6f19fb51856563aed54..4acccf9b8c9c304eddd04950ee865752bd04d856 100644 (file)
@@ -1,33 +1,10 @@
-function(to_hex HEX)
-    # mind you, not really hexadecimal, but just a decimal in hex notation, huh?!
-    set(XNUMBER 0x)
-    foreach(DEC IN LISTS ARGN)
-        while(1)
-            string(LENGTH "${DEC}" LEN)
-            if(LEN GREATER_EQUAL 3)
-                break()
-            endif()
-            string(CONCAT DEC "0" "${DEC}")
-        endwhile()
-        if(DEC GREATER 999)
-            message(WARNING "to_hex(HEX ${DEC}): decimal wider than 3 digits")
-        endif()
-        string(APPEND XNUMBER ${DEC})
-    endforeach()
-    set(${HEX} ${XNUMBER} PARENT_SCOPE)
-endfunction()
-
 #
 # libmemcached
 #
 
-set(LIBMEMCACHED_VERSION_MAJOR 1)
-set(LIBMEMCACHED_VERSION_MINOR 1)
-set(LIBMEMCACHED_VERSION_PATCH 0)
-
-set(LIBMEMCACHED_VERSION ${LIBMEMCACHED_VERSION_MAJOR}.${LIBMEMCACHED_VERSION_MINOR}.${LIBMEMCACHED_VERSION_PATCH})
-set(LIBMEMCACHED_VERSION_INC ${LIBMEMCACHED_VERSION_MAJOR}.0)
-to_hex(LIBMEMCACHED_VERSION_HEX ${LIBMEMCACHED_VERSION_MAJOR} ${LIBMEMCACHED_VERSION_MINOR} ${LIBMEMCACHED_VERSION_PATCH})
+set(LIBMEMCACHED_VERSION 1.1.0)
+set(LIBMEMCACHED_VERSION_INC 1.0)
+set(LIBMEMCACHED_VERSION_HEX 0x001001000)
 
 # libmemcached.so
 
@@ -38,13 +15,9 @@ set(LIBMEMCACHED_SO_VERSION ${LIBMEMCACHED_SO_SOVERSION}.0.0)
 # libmemcachedutil
 #
 
-set(LIBMEMCACHEDUTIL_VERSION_MAJOR 1)
-set(LIBMEMCACHEDUTIL_VERSION_MINOR 1)
-set(LIBMEMCACHEDUTIL_VERSION_PATCH 0)
-
-set(LIBMEMCACHEDUTIL_VERSION ${LIBMEMCACHEDUTIL_VERSION_MAJOR}.${LIBMEMCACHEDUTIL_VERSION_MINOR}.${LIBMEMCACHEDUTIL_VERSION_PATCH})
-set(LIBMEMCACHEDUTIL_VERSION_INC ${LIBMEMCACHEDUTIL_VERSION_MAJOR}.0)
-to_hex(LIBMEMCACHEDUTIL_VERSION_HEX ${LIBMEMCACHEDUTIL_VERSION_MAJOR} ${LIBMEMCACHEDUTIL_VERSION_MINOR} ${LIBMEMCACHEDUTIL_VERSION_PATCH})
+set(LIBMEMCACHEDUTIL_VERSION 1.1.0)
+set(LIBMEMCACHEDUTIL_VERSION_INC 1.0)
+set(LIBMEMCACHEDUTIL_VERSION_HEX 0x001001000)
 
 # libmemcachedutil.so
 
@@ -55,13 +28,9 @@ set(LIBMEMCACHEDUTIL_SO_VERSION ${LIBMEMCACHEDUTIL_SO_SOVERSION}.0.0)
 # libmemcachedprotocol
 #
 
-set(LIBMEMCACHEDPROTOCOL_VERSION_MAJOR 0)
-set(LIBMEMCACHEDPROTOCOL_VERSION_MINOR 1)
-set(LIBMEMCACHEDPROTOCOL_VERSION_PATCH 0)
-
-set(LIBMEMCACHEDPROTOCOL_VERSION ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR}.${LIBMEMCACHEDPROTOCOL_VERSION_MINOR}.${LIBMEMCACHEDPROTOCOL_VERSION_PATCH})
-set(LIBMEMCACHEDPROTOCOL_VERSION_INC ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR}.0)
-to_hex(LIBMEMCACHEDPROTOCOL_VERSION_HEX ${LIBMEMCACHEDPROTOCOL_VERSION_MAJOR} ${LIBMEMCACHEDPROTOCOL_VERSION_MINOR} ${LIBMEMCACHEDPROTOCOL_VERSION_PATCH})
+set(LIBMEMCACHEDPROTOCOL_VERSION 0.1.0)
+set(LIBMEMCACHEDPROTOCOL_VERSION_INC 0.0)
+set(LIBMEMCACHEDPROTOCOL_VERSION_HEX 0x000001000)
 
 # libmemcachedprotocol.so
 
@@ -72,13 +41,9 @@ set(LIBMEMCACHEDPROTOCOL_SO_VERSION ${LIBMEMCACHEDPROTOCOL_SO_SOVERSION}.0.0)
 # libhashkit
 #
 
-set(LIBHASHKIT_VERSION_MAJOR 1)
-set(LIBHASHKIT_VERSION_MINOR 1)
-set(LIBHASHKIT_VERSION_PATCH 0)
-
-set(LIBHASHKIT_VERSION ${LIBHASHKIT_VERSION_MAJOR}.${LIBHASHKIT_VERSION_MINOR}.${LIBHASHKIT_VERSION_PATCH})
-set(LIBHASHKIT_VERSION_INC ${LIBHASHKIT_VERSION_MAJOR}.0)
-to_hex(LIBHASHKIT_VERSION_HEX ${LIBHASHKIT_VERSION_MAJOR} ${LIBHASHKIT_VERSION_MINOR} ${LIBHASHKIT_VERSION_PATCH})
+set(LIBHASHKIT_VERSION 1.1.0)
+set(LIBHASHKIT_VERSION_INC 1.0)
+set(LIBHASHKIT_VERSION_HEX 0x00100100)
 
 # libhashkit.so