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 c94269f commit 61d1b58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Corrade/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ if(Git_FOUND)
OUTPUT_VARIABLE CORRADE_VERSION_STRING
RESULT_VARIABLE _CORRADE_VERSION_RESULT
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(CORRADE_VERSION_STRING MATCHES "^v([0-9][0-9][0-9][0-9])\\.0?([0-9][0-9])-([0-9]+)-g([a-f0-9]+)$")
if(CORRADE_VERSION_STRING MATCHES "^v([0-9][0-9][0-9][0-9])\\.0?([0-9][0-9]?)-([0-9]+)-g([a-f0-9]+)$")
set(CORRADE_VERSION_YEAR ${CMAKE_MATCH_1})
set(CORRADE_VERSION_MONTH ${CMAKE_MATCH_2})
set(CORRADE_VERSION_COMMIT ${CMAKE_MATCH_3})
# Otherwise if commit is 0, it would #undef the variable
set(CORRADE_VERSION_COMMIT " ${CORRADE_VERSION_COMMIT}")
set(CORRADE_VERSION_HASH ${CMAKE_MATCH_4})
elseif(_CORRADE_VERSION_RESULT EQUAL 0)
message(WARNING "Can't match Git version from ${CORRADE_VERSION_STRING}")
Expand Down
2 changes: 1 addition & 1 deletion src/Corrade/version.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#define CORRADE_VERSION_YEAR ${CORRADE_VERSION_YEAR}
#define CORRADE_VERSION_MONTH ${CORRADE_VERSION_MONTH}
#cmakedefine CORRADE_VERSION_COMMIT ${CORRADE_VERSION_COMMIT}
#cmakedefine CORRADE_VERSION_COMMIT${CORRADE_VERSION_COMMIT}
#cmakedefine CORRADE_VERSION_HASH 0x${CORRADE_VERSION_HASH}
#cmakedefine CORRADE_VERSION_STRING "${CORRADE_VERSION_STRING}"

Expand Down

0 comments on commit 61d1b58

Please sign in to comment.