misc.cmake 578 B

12345678910111213141516171819202122
  1. #
  2. # Random macros
  3. #
  4. # Not used ATM
  5. MACRO (GETDATETIME RESULT)
  6. IF (WIN32)
  7. EXECUTE_PROCESS(COMMAND "cmd" /C echo %date% %time% OUTPUT_VARIABLE ${RESULT})
  8. string(REGEX REPLACE "\n" "" ${RESULT} "${${RESULT}}")
  9. ELSEIF(UNIX)
  10. EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d_%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
  11. string(REGEX REPLACE "\n" "" ${RESULT} "${${RESULT}}")
  12. ELSE (WIN32)
  13. MESSAGE(SEND_ERROR "date not implemented")
  14. SET(${RESULT} "Unknown")
  15. ENDIF (WIN32)
  16. string(REGEX REPLACE " " "_" ${RESULT} "${${RESULT}}")
  17. ENDMACRO (GETDATETIME)