[CMake] correct DEPENDS behaviour ?

Brad King brad.king at kitware.com
Fri Jan 6 16:47:49 EST 2006


Alexander Neundorf wrote:
> CMakeLists.txt: 
> ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h 
> COMMAND  sh ARGS -c "echo //>generated.h" 
> DEPENDS blah.h 
> #DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/blah.h 
> ) 
[snip]
> if I put only "DEPENDS blah.h" in the custom command, this dependency is 
> not generated in build.make. This is an in-source-build and no subdirs or  
> anything. Is this the expected behaviour ? 

In older CMake versions we did not support relative path specifications 
to anything but the source files in the same source directory as the 
CMakeLists.txt file.  We have been extending the number of places that 
support this, but this case has been missed.  At one time I proposed 
sending all input arguments that are supposed to be paths through a 
single translation mechanism so that this is fixed everywhere.  This has 
not been implemented though so piecewise bugs like this still exist.

I'll look at this when I get a chance.

-Brad


More information about the CMake mailing list