Fixed getting the current time wrong in the script file (#712)
Co-authored-by: Yang Kun <13147081-ikspress@users.noreply.gitlab.com>
This commit is contained in:
parent
1f77bcec17
commit
d40cbef104
1 changed files with 1 additions and 15 deletions
|
@ -188,21 +188,7 @@ ENDIF(LIBUSB_INCLUDE_DIRS)
|
||||||
# version.rc for Windows
|
# version.rc for Windows
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
# Date for filling in rc file information
|
# Date for filling in rc file information
|
||||||
IF (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
STRING(TIMESTAMP CURRENT_YEAR %Y)
|
||||||
MACRO (GET_CURRENT_YEAR RESULT)
|
|
||||||
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
|
|
||||||
STRING(REGEX REPLACE "\n" "" ${RESULT} ${${RESULT}})
|
|
||||||
STRING(REGEX REPLACE ".*(..)/(..)/(....).*" "\\3" ${RESULT} ${${RESULT}})
|
|
||||||
ENDMACRO (GET_CURRENT_YEAR)
|
|
||||||
ELSE(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
|
||||||
MACRO (GET_CURRENT_YEAR RESULT)
|
|
||||||
EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE ${RESULT})
|
|
||||||
STRING(REGEX REPLACE "\n" "" ${RESULT} ${${RESULT}})
|
|
||||||
ENDMACRO (GET_CURRENT_YEAR)
|
|
||||||
ENDIF(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
|
||||||
GET_CURRENT_YEAR(CURRENT_YEAR)
|
|
||||||
MESSAGE("Year for copyright is " ${CURRENT_YEAR})
|
|
||||||
|
|
||||||
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
SET(RC_COMMENT "${PACKAGE_NAME} library")
|
SET(RC_COMMENT "${PACKAGE_NAME} library")
|
||||||
SET(RC_INTERNAL_NAME "${PACKAGE_NAME} ${WIN32_MODE}")
|
SET(RC_INTERNAL_NAME "${PACKAGE_NAME} ${WIN32_MODE}")
|
||||||
|
|
Loading…
Reference in a new issue