Get rid of leading zeros in date tags, causing them to be interpreted as octal in C++

brodykenrick-master
Marius Kintel 2013-11-08 00:34:01 -05:00
parent 77829d0a3a
commit e722d906ce
1 changed files with 2 additions and 0 deletions

View File

@ -450,9 +450,11 @@ message(STATUS "OpenSCAD version: ${VERSION}")
string(REGEX MATCHALL "^[0-9]+|[0-9]+|[0-9]+$" MYLIST "${VERSION}")
list(GET MYLIST 0 OPENSCAD_YEAR)
list(GET MYLIST 1 OPENSCAD_MONTH)
math(EXPR OPENSCAD_MONTH ${OPENSCAD_MONTH}) # get rid of leading zero
list(LENGTH MYLIST VERSIONLEN)
if (${VERSIONLEN} EQUAL 3)
list(GET MYLIST 2 OPENSCAD_DAY)
math(EXPR OPENSCAD_DAY ${OPENSCAD_DAY}) # get rid of leading zero
endif()
add_definitions(-DOPENSCAD_VERSION=${VERSION} -DOPENSCAD_YEAR=${OPENSCAD_YEAR} -DOPENSCAD_MONTH=${OPENSCAD_MONTH})