cmake TIMESTAMP not working with older cmake
[unres.git] / CMakeLists.txt
index 0e6f8ca..689bb9c 100644 (file)
@@ -20,9 +20,10 @@ MACRO (TODAY RESULT)
         EXECUTE_PROCESS(COMMAND "date" "/T" OUTPUT_VARIABLE ${RESULT})
         string(REGEX REPLACE "(..)/(..)/..(..).*" "\\3\\2\\1" ${RESULT} ${${RESULT}})
     ELSEIF(UNIX)
-#        EXECUTE_PROCESS(COMMAND "date" OUTPUT_VARIABLE ${RESULT})
-#        string(REGEX REPLACE "(...) (...) (.+) (..:..:..) (.+) (....).*" "\\1 \\2 \\3 \\4 \\5 \\6" ${RESULT} ${${RESULT}})
-        string(TIMESTAMP ${RESULT})
+        EXECUTE_PROCESS(COMMAND "date" "+'%D %R:%S'" OUTPUT_VARIABLE ${RESULT})
+        string(REGEX REPLACE "'" ""  ${RESULT} ${${RESULT}})
+        string (STRIP ${${RESULT}} ${RESULT})
+#        string(TIMESTAMP ${RESULT})
     ELSE (WIN32)
         MESSAGE(SEND_ERROR "date not implemented")
         SET(${RESULT} 000000)