Hy,<br><br>I want to retrieve today date in order to install various release each day.<br>I've created a script: GetDataTime.cmake<br><br>In which I have defined this macro:<br><br>INCLUDE(FindPerl)<br>MACRO (TODAY RESULT)
<br>IF (PERL_FOUND)<br> EXECUTE_PROCESS(COMMAND "${PERL_EXECUTABLE}" "-E '($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); printf \"%02d%02d%02d\",$year-100,$mon+1,$mday;'" OUTPUT_VARIABLE ${RESULT})<br>
MESSAGE( STATUS "(in) ${RESULT}")<br>ELSE (PERL_FOUND)<br> MESSAGE(SEND_ERROR "Perl needed to obtain today date")<br>ENDIF(PERL_FOUND)
<br>ENDMACRO (TODAY)<br><br>Then in the CMakeList.txt I have call<br>INCLUDE(GetTime)<br>TODAY(VAR)<br>MESSAGE( STATUS "TODAY is ${VAR}")<br><br><br>When i call the makefile I have:<br>-- (in) VAR<br>-- Correctly setted <br>
<br><br>Someone can tell me how to use a macro to retrieve a result because I'm not sure to understand!!!!<br><br clear="all"><br>--<br>Benoit RAT<br><a href="http://www.neub.co.nr">www.neub.co.nr</a><br>