Skip to content

Commit

Permalink
Fixed getting the current time wrong in the script file (#712)
Browse files Browse the repository at this point in the history
Co-authored-by: Yang Kun <[email protected]>
  • Loading branch information
ikspress and Yang Kun committed Feb 16, 2024
1 parent 1f77bce commit d40cbef
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,7 @@ ENDIF(LIBUSB_INCLUDE_DIRS)
# version.rc for Windows
IF(WIN32)
# Date for filling in rc file information
IF (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
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})

STRING(TIMESTAMP CURRENT_YEAR %Y)
SET(prefix ${CMAKE_INSTALL_PREFIX})
SET(RC_COMMENT "${PACKAGE_NAME} library")
SET(RC_INTERNAL_NAME "${PACKAGE_NAME} ${WIN32_MODE}")
Expand Down

0 comments on commit d40cbef

Please sign in to comment.