[CMake] Add custom command problem ?

Robert Bielik robert.bielik at xponaut.se
Fri Dec 10 03:23:52 EST 2010


Hi all,

Using 2.8.2 I'm trying to make a rule to create a timestamp header, but only if a certain file has changed, like so:

ADD_CUSTOM_COMMAND(
   OUTPUT src/timestamp.h
   COMMAND tools/win32/timestamper
   ARGS src/timestamp.h
   DEPENDS Version.cmake
   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
   COMMENT "Generating timestamp header..."
)

but the rule is always executed, even if the Version.cmake file has not changed. What am I doing wrong ?

TIA
/Rob


More information about the CMake mailing list