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 0cba508 commit fac6f4d
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 @@ -38,10 +38,12 @@ if(Git_FOUND)
OUTPUT_VARIABLE MAGNUM_VERSION_STRING
RESULT_VARIABLE _MAGNUM_VERSION_RESULT
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(MAGNUM_VERSION_STRING MATCHES "^v([0-9][0-9][0-9][0-9])\\.0?([0-9][0-9])-([0-9]+)-g([a-f0-9]+)$")
if(MAGNUM_VERSION_STRING MATCHES "^v([0-9][0-9][0-9][0-9])\\.0?([0-9][0-9]?)-([0-9]+)-g([a-f0-9]+)$")
set(MAGNUM_VERSION_YEAR ${CMAKE_MATCH_1})
set(MAGNUM_VERSION_MONTH ${CMAKE_MATCH_2})
set(MAGNUM_VERSION_COMMIT ${CMAKE_MATCH_3})
# Otherwise if commit is 0, it would #undef the variable
set(MAGNUM_VERSION_COMMIT " ${MAGNUM_VERSION_COMMIT}")
set(MAGNUM_VERSION_HASH ${CMAKE_MATCH_4})
elseif(_MAGNUM_VERSION_RESULT EQUAL 0)
message(WARNING "Can't match Git version from ${MAGNUM_VERSION_STRING}")
Expand Down
2 changes: 1 addition & 1 deletion src/Magnum/version.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#define MAGNUM_VERSION_YEAR ${MAGNUM_VERSION_YEAR}
#define MAGNUM_VERSION_MONTH ${MAGNUM_VERSION_MONTH}
#cmakedefine MAGNUM_VERSION_COMMIT ${MAGNUM_VERSION_COMMIT}
#cmakedefine MAGNUM_VERSION_COMMIT${MAGNUM_VERSION_COMMIT}
#cmakedefine MAGNUM_VERSION_HASH 0x${MAGNUM_VERSION_HASH}
#cmakedefine MAGNUM_VERSION_STRING "${MAGNUM_VERSION_STRING}"

Expand Down

0 comments on commit fac6f4d

Please sign in to comment.