GetDate.cmake 563 B

12345678910111213
  1. MACRO (TODAY RESULT)
  2. IF (WIN32)
  3. #EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
  4. #string(REGEX REPLACE "(..)/(..)/(....).*" "\\3\\2\\1" ${RESULT} ${${RESULT}})
  5. set(${RESULT})
  6. ELSEIF(UNIX)
  7. EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
  8. string(REGEX REPLACE "(..)/(..)/(....).*" "\\3\\2\\1" ${RESULT} ${${RESULT}})
  9. ELSE (WIN32)
  10. MESSAGE(SEND_ERROR "date not implemented")
  11. SET(${RESULT} 000000)
  12. ENDIF (WIN32)
  13. ENDMACRO (TODAY)