Skip to content

Commit

Permalink
Of course I messed up generating the version header.
Browse files Browse the repository at this point in the history
Trailing zeros, undef'd "falsy" variable. Sigh.
  • Loading branch information
mosra committed Jun 27, 2020
1 parent 2df41d3 commit 661e824
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Magnum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion src/Magnum/versionBindings.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down

0 comments on commit 661e824

Please sign in to comment.