ontag, 9. Dezember 2013 09:01
> To: Matthew Woehlke
> Cc: cmake@cmake.org
> Subject: Re: [CMake] [CMAKE] Getting compilation date through CMake
>
> BTW, just for other newbies, I think my mistake was that I took another
> external command example literally:
>
> EX
Montag, 9. Dezember 2013 09:01
To: Matthew Woehlke
Cc: cmake@cmake.org
Subject: Re: [CMake] [CMAKE] Getting compilation date through CMake
BTW, just for other newbies, I think my mistake was that I took another
external command example literally:
EXECUTE_PROCESS(
COMMAND
svnversion -nc &q
BTW, just for other newbies, I think my mistake was that I took another
external command example literally:
EXECUTE_PROCESS(
COMMAND
svnversion -nc "${sourceDir}"
OUTPUT_VARIABLE _out_svnversion
)
Now I guess the above works (without invoking the command prompt) because a
FindSubversion.cma
Dear Fraser and Matthew,
yes, both approaches work. Thank you.
There seems to be a trailing endline in the response given by $ENV{COMSPEC}
/c date /t, so the following regex helps deleting it:
STRING(REGEX REPLACE "(\r?\n)+$" "" _date "${_date}")
Thanks again,
JON HAITZ
On 5 December 2013 22:
On 2013-12-05 15:46, Fraser Hutchison wrote:
If you can specify CMake version 2.8.11 as a minimum, you could use
the string(TIMESTAMP ...) command instead:
string(TIMESTAMP _output "%d/%m/%Y")
Bear in mind that these only execute when CMake runs (i.e. at configure time)
rather than at build tim
Hi Jon,
You'd have to invoke the command prompt to execute this I think. On
Windows this should be the value of the COMSPEC environment
variable, so your command would be something like:
execute_process(COMMAND
$ENV{COMSPEC} /c date /t
OUTPUT_VA
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