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 f65ff93 commit b0f2818
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 MAGNUMPLUGINS_VERSION_STRING
RESULT_VARIABLE _MAGNUMPLUGINS_VERSION_RESULT
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(MAGNUMPLUGINS_VERSION_STRING MATCHES "^v([0-9][0-9][0-9][0-9])\\.0?([0-9][0-9])-([0-9]+)-g([a-f0-9]+)$")
if(MAGNUMPLUGINS_VERSION_STRING MATCHES "^v([0-9][0-9][0-9][0-9])\\.0?([0-9][0-9]?)-([0-9]+)-g([a-f0-9]+)$")
set(MAGNUMPLUGINS_VERSION_YEAR ${CMAKE_MATCH_1})
set(MAGNUMPLUGINS_VERSION_MONTH ${CMAKE_MATCH_2})
set(MAGNUMPLUGINS_VERSION_COMMIT ${CMAKE_MATCH_3})
# Otherwise if commit is 0, it would #undef the variable
set(MAGNUMPLUGINS_VERSION_COMMIT " ${MAGNUMPLUGINS_VERSION_COMMIT}")
set(MAGNUMPLUGINS_VERSION_HASH ${CMAKE_MATCH_4})
elseif(_MAGNUMPLUGINS_VERSION_RESULT EQUAL 0)
message(WARNING "Can't match Git version from ${MAGNUMPLUGINS_VERSION_STRING}")
Expand Down
2 changes: 1 addition & 1 deletion src/Magnum/versionPlugins.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#define MAGNUMPLUGINS_VERSION_YEAR ${MAGNUMPLUGINS_VERSION_YEAR}
#define MAGNUMPLUGINS_VERSION_MONTH ${MAGNUMPLUGINS_VERSION_MONTH}
#cmakedefine MAGNUMPLUGINS_VERSION_COMMIT ${MAGNUMPLUGINS_VERSION_COMMIT}
#cmakedefine MAGNUMPLUGINS_VERSION_COMMIT${MAGNUMPLUGINS_VERSION_COMMIT}
#cmakedefine MAGNUMPLUGINS_VERSION_HASH 0x${MAGNUMPLUGINS_VERSION_HASH}
#cmakedefine MAGNUMPLUGINS_VERSION_STRING "${MAGNUMPLUGINS_VERSION_STRING}"

Expand Down

0 comments on commit b0f2818

Please sign in to comment.