On 12/10/2010 09:23 AM, Robert Bielik wrote: > 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
1. Always use absolute paths (e.g. using CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR). 2. Never create output in the source tree. HTH Michael _______________________________________________ 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