[CMake] multiple targets depending on generated file

Stephen Kelly steveire at gmail.com
Thu Apr 7 15:34:00 EDT 2011


Brad King wrote:

>>
>> Is this a bug in CMake?  It seems there is enough information given that
>> CMake could notice the dependency.  But maybe it can't quite do it
>> because its a separate directory?  Maybe cmake can do the
>> add_dependencies() automatically?
> 
> This is expected.  You need to do add_dependencies or use a separate
> custom target and then make both targets depend on that.  CMake cannot
> just magically introduce an extra custom target or arbitrary dependency
> between existing targets.
> 

I checked the documentation for these:

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_dependencies

http://www.cmake.org/cmake/help/cmake-2-8-
docs.html#command:set_source_files_properties

It seems that the case I'm trying to solve would be far easier if it was 
possible to have file level dependencies in different directories.  

Is that feasible? It would be cool to have that dependency be internal. I'm 
using a macro wrapper similar to the one in the bug report, but sometimes I 
still get build failures due to the dbus xml stuff that I haven't tracked 
down and which are resolved on the next build.




More information about the CMake mailing list