[Cmake] Getting the current time

Andy Cedilnik andy.cedilnik at kitware.com
Wed Sep 8 10:58:36 EDT 2004


Hi Kris,

You could do something like:

SET(NEED_FLAG)
IF(WIN32)
  IF(NOT CYGWIN)
    SET(NEED_FLAG "/T")
  ENDIF(NOT CYGWIN)
ENDIF(WIN32)

EXEC_PROGRAM(date ARGS ${NEED_FLAG} OUTPUT_VARIABLE CURRENT_DATE)

				Andy


On Wed, 2004-09-08 at 10:33, Dekeyser, Kris wrote:
> Is there a way to get hold of the current time in CMake ? I'm trying
> to use CONFIGURE_FILE to create a resource file for MSDev 6 DLL
> targets with CMake. I'd like to burn the targets with the host name
> and time of the build. SITE_NAME covers my first need, but I'm still
> looking for the second one. Has anyone yet created a custom command
> for this?




More information about the Cmake mailing list