I figured out something that makes me even more puzzled. The following
does _not_ work as expected::

set(DEPS "dep1 dep2 dep3")
add_dependencies(foo bar
                                ${DEPS})

Target "foo" gets only dependent on bar and not dep1,2,3. On the other
hand, manually listing the latter instead of using the DEPS variable
works as well as adding them one-by-one in a loop (where also a
variables is used).

This seems to be _extremely_counterintuitive! Is there some sort of
CMake black-magic or basic rule that I don't know of?

--
Szilárd



On Sun, Sep 26, 2010 at 9:09 PM, Szilárd Páll <szilard.p...@cbr.su.se> wrote:
>> The DEPENDS option of ADD_CUSTOM_TARGET() is meant for file-level
>> dependencies only; use ADD_DEPENDENCIES() for target-level ones.
>
> Silly mistake, thanks for pointing it out. However, even if I add
> target dependencies using ADD_DEPENDENCIES() it seems to take into
> account only the dependent the binary targets (bar, see above), but
> the custom ones (dep1,2,3) are completely ignored. What could be still
> wrong?
>
> Also, strangely enough, if I list the binary target in the
> add_custom_target's DEPENDS section (like in my initial example), it
> does work. Is this just because I am lucky enough that the the
> dependency itself is a binary with the same name as the target I
> actually intended to refer to?
>
> --
> Szilárd
>
_______________________________________________
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

Reply via email to