[CMake] [CMAKE] Getting compilation date through CMake

Jon Haitz Legarreta jhlegarreta at vicomtech.org
Thu Dec 5 14:32:20 EST 2013


Hi there,
I was trying to get the compilation time through a CMake-executed command
in order to know the compilation time of a given project.
In my custom.cmake file I was using

execute_process(COMMAND
    date -t
    OUTPUT_VARIABLE _output
)

It turns out that the _output variable is empty when I compile my project.
However, the command works well from the command line. I'm working on a Win
7  64-bit machine.

I wanted to avoid using an extra C/C++ code file to get the current time.

Am I missing something?

Thank you,
JON HAITZ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131205/80db624e/attachment.htm>


More information about the CMake mailing list