I'm having trouble understanding CMake. I want to execute the following bash command during the build process:
date +"%F %T" > timestamp
Selects the current date and writes it to a file. However, I cannot reproduce this simple action using CMake commands.
Here are some things I've tried:
execute_process(COMMAND "date +'%F %T' > timestamp")
add_custom_command(OUTPUT timestamp COMMAND date +"%F %T")
file(WRITE timestamp date +"%F %T")
Nothing works. I almost wonder if they are even executed at all.
I have very limited knowledge of how CMake and its syntax, so I probably do very poorly. I hope someone can point me in the right direction. Thanks!
source share