From 661e8243cd52d3e1110112fb15c105959c572c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 27 Jun 2020 11:43:26 +0200 Subject: [PATCH] Of course I messed up generating the version header. Trailing zeros, undef'd "falsy" variable. Sigh. --- src/Magnum/CMakeLists.txt | 4 +++- src/Magnum/versionBindings.h.cmake | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 010ab654..0740f9cd 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -34,10 +34,12 @@ if(Git_FOUND) OUTPUT_VARIABLE MAGNUMBINDINGS_VERSION_STRING RESULT_VARIABLE _MAGNUMBINDINGS_VERSION_RESULT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - if(MAGNUMBINDINGS_VERSION_STRING MATCHES "^v([0-9][0-9][0-9][0-9])\\.0?([0-9][0-9])-([0-9]+)-g([a-f0-9]+)$") + if(MAGNUMBINDINGS_VERSION_STRING MATCHES "^v([0-9][0-9][0-9][0-9])\\.0?([0-9][0-9]?)-([0-9]+)-g([a-f0-9]+)$") set(MAGNUMBINDINGS_VERSION_YEAR ${CMAKE_MATCH_1}) set(MAGNUMBINDINGS_VERSION_MONTH ${CMAKE_MATCH_2}) set(MAGNUMBINDINGS_VERSION_COMMIT ${CMAKE_MATCH_3}) + # Otherwise if commit is 0, it would #undef the variable + set(MAGNUMBINDINGS_VERSION_COMMIT " ${MAGNUMBINDINGS_VERSION_COMMIT}") set(MAGNUMBINDINGS_VERSION_HASH ${CMAKE_MATCH_4}) elseif(_MAGNUMBINDINGS_VERSION_RESULT EQUAL 0) message(WARNING "Can't match Git version from ${MAGNUMBINDINGS_VERSION_STRING}") diff --git a/src/Magnum/versionBindings.h.cmake b/src/Magnum/versionBindings.h.cmake index 86c12737..fecbb8df 100644 --- a/src/Magnum/versionBindings.h.cmake +++ b/src/Magnum/versionBindings.h.cmake @@ -31,7 +31,7 @@ #define MAGNUMBINDINGS_VERSION_YEAR ${MAGNUMBINDINGS_VERSION_YEAR} #define MAGNUMBINDINGS_VERSION_MONTH ${MAGNUMBINDINGS_VERSION_MONTH} -#cmakedefine MAGNUMBINDINGS_VERSION_COMMIT ${MAGNUMBINDINGS_VERSION_COMMIT} +#cmakedefine MAGNUMBINDINGS_VERSION_COMMIT${MAGNUMBINDINGS_VERSION_COMMIT} #cmakedefine MAGNUMBINDINGS_VERSION_HASH 0x${MAGNUMBINDINGS_VERSION_HASH} #cmakedefine MAGNUMBINDINGS_VERSION_STRING "${MAGNUMBINDINGS_VERSION_STRING}"