[CMAKE]: ADD_DEPENDENCIES not working as expected

wedekind wedekind at caesar.de
Thu Jan 4 10:00:42 EST 2007


Hello all,

recently I have encountered a unexpected behaviour of ADD_DEPENDENCIES. My
goal is to have a set of targets that are not built with the ALL-target.
They should be built using an empty "helper-target". The helper-target is an
empty custom target in a CMakeLists.txt in some root-directory:

ADD_CUSTOM_TARGET(HELPER_TARGET)
ADD_SUBDIRECTORY(subdir)

Now I want to use ADD_DEPENDENCIES on a target located in a subdir:

ADD_LIBRARY(someLib EXCLUDE_FROM_ALL someCode.cpp)
ADD_DEPENDENCIES(HELPER_TARGET someLib)

Should it work this way? Anyway, cmake is reporting an error:

ADD_DEPENDENCIES Adding dependency to non-existent target: HELPER_TARGET

Did I do something wrong in the CMakeLists.txt-files above? How can it be
made working?

Cheers

Marco




More information about the CMake mailing list