You're using incorrect arguments as DEPENDS. Things that follow DEPENDS should be full path file names... not cmake target names.<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br><br><div class="gmail_quote">
On Wed, Aug 19, 2009 at 11:47 AM, Tim Kientzle <span dir="ltr"><<a href="mailto:kientzle@freebsd.org">kientzle@freebsd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Tim Kientzle wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Tim Kientzle wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm having trouble with a custom target that<br>
depends on another custom target defined in a<br>
subdirectory. Here's a much-simplified version<br>
of what I'm trying to do:<br>
</blockquote>
<br>
Turns out the subdirectory is a red herring.<br>
Here's a much simpler demonstration of the bug:<br>
<br>
$ cat CMakeLists.txt<br>
PROJECT(foobar C)<br>
ADD_EXECUTABLE(foo foo.c)<br>
ADD_CUSTOM_TARGET(run_foo DEPENDS foo COMMAND foo)<br>
ADD_CUSTOM_TARGET(run_all DEPENDS run_foo)<br>
$ make run_all<br>
[100%] Built target foo<br>
Scanning dependencies of target run_foo<br>
foo<br>
[100%] Built target run_foo<br>
Scanning dependencies of target run_all<br>
make: don't know how to make run_foo. Stop<br>
*** Error code 2<br>
</blockquote>
<br>
Unfortunately, my original message with the<br>
background went astray.<br>
<br>
The above is a much-simplified version of a problem<br>
I've been struggling with. The CMakeLists.txt<br>
above generates something that works fine with<br>
Visual Studio (the "run_all" target does "run_foo"<br>
as expected with no errors). But if I use a<br>
Makefile generator (on FreeBSD 8, in this case),<br>
then I see the strange behavior above: The<br>
run_foo target does get run (the "foo" string<br>
is output from the compiled foo.c) and the build<br>
then fails being unable to locate run_foo as<br>
a dependency of run_all.<br>
<br>
Having skimmed the Makefiles produced by CMake,<br>
I'm pretty sure this is a bug in how the generator<br>
organizes the makefiles; it puts dependency information<br>
in places where it can't possibly work.<br>
<br>
Cheers,<br>
<br>
Tim<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>