1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

Merge PR #700: CMake: fix date/time leading 0 removal regex and print both during configuration

This commit is contained in:
Davide Beatrici 2018-09-14 04:20:32 +02:00 committed by GitHub
commit ebfde9c97f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,12 +42,15 @@ string(TIMESTAMP BUILD_MINUTE "%M" UTC)
string(TIMESTAMP BUILD_SECOND "%S" UTC) string(TIMESTAMP BUILD_SECOND "%S" UTC)
## Remove leading 0 ## Remove leading 0
string(REGEX REPLACE "^0" "" BUILD_DAY "${BUILD_DAY}") string(REGEX REPLACE "^0([^ ]*)" "\\1" BUILD_DAY "${BUILD_DAY}")
string(REGEX REPLACE "^0" "" BUILD_MONTH "${BUILD_MONTH}") string(REGEX REPLACE "^0([^ ]*)" "\\1" BUILD_MONTH "${BUILD_MONTH}")
string(REGEX REPLACE "^0" "" BUILD_YEAR "${BUILD_YEAR}") string(REGEX REPLACE "^0([^ ]*)" "\\1" BUILD_YEAR "${BUILD_YEAR}")
string(REGEX REPLACE "^0" "" BUILD_HOUR "${BUILD_HOUR}") string(REGEX REPLACE "^0([^ ]*)" "\\1" BUILD_HOUR "${BUILD_HOUR}")
string(REGEX REPLACE "^0" "" BUILD_MINUTE "${BUILD_MINUTE}") string(REGEX REPLACE "^0([^ ]*)" "\\1" BUILD_MINUTE "${BUILD_MINUTE}")
string(REGEX REPLACE "^0" "" BUILD_SECOND "${BUILD_SECOND}") string(REGEX REPLACE "^0([^ ]*)" "\\1" BUILD_SECOND "${BUILD_SECOND}")
message(STATUS "Build date: ${BUILD_DAY}/${BUILD_MONTH}/${BUILD_YEAR}")
message(STATUS "Build time: ${BUILD_HOUR}:${BUILD_MINUTE}:${BUILD_SECOND}")
add_definitions(-DBUILD_DATE_D=${BUILD_DAY} -DBUILD_DATE_M=${BUILD_MONTH} -DBUILD_DATE_Y=${BUILD_YEAR}) add_definitions(-DBUILD_DATE_D=${BUILD_DAY} -DBUILD_DATE_M=${BUILD_MONTH} -DBUILD_DATE_Y=${BUILD_YEAR})
add_definitions(-DBUILD_DATE_HO=${BUILD_HOUR} -DBUILD_DATE_MI=${BUILD_MINUTE} -DBUILD_DATE_SE=${BUILD_SECOND}) add_definitions(-DBUILD_DATE_HO=${BUILD_HOUR} -DBUILD_DATE_MI=${BUILD_MINUTE} -DBUILD_DATE_SE=${BUILD_SECOND})