Hy,

I want to retrieve today date in order to install various release each day.
I've created a script: GetDataTime.cmake

In which I have defined this macro:

INCLUDE(FindPerl)
MACRO (TODAY RESULT)
IF (PERL_FOUND)
    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})
    MESSAGE( STATUS "(in) ${RESULT}")
ELSE (PERL_FOUND)
          MESSAGE(SEND_ERROR "Perl needed to obtain today date")
ENDIF(PERL_FOUND)
ENDMACRO (TODAY)

Then in the CMakeList.txt I have call
INCLUDE(GetTime)
TODAY(VAR)
MESSAGE( STATUS "TODAY is ${VAR}")


When i call the makefile I have:
-- (in) VAR
-- Correctly setted


Someone can tell me how to use a macro to retrieve a result because I'm not
sure to understand!!!!


--
Benoit RAT
www.neub.co.nr
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to