[CMake] intra-targets dependencies

Andrea Crotti andrea.crotti.0 at gmail.com
Thu Feb 23 10:06:06 EST 2012


Reading the documentation in add_custom_target I see this:

Dependencies listed with the DEPENDS
        argument may reference files and outputs of custom commands created
        with add_custom_command() in the same directory (CMakeLists.txt 
file).


But this actually works just fine

add_custom_target(a
   ${CMAKE_COMMAND} -E echo "a"
   )

add_custom_target(b
   ${CMAKE_COMMAND} -E echo "b"
   DEPENDS a
   )

and now b depends on a.
So is the documentation wrong?
Because from what I gathered from it intra-dependencies relationships 
have to be defined only with
add_dependencies, but that doesn't explain why the above example works..

Thanks,
Andrea


More information about the CMake mailing list