On Wed, Feb 25, 2009 at 7:54 AM, Brad King <[email protected]> wrote: > Michael Wild wrote: >> >> On 25. Feb, 2009, at 7:25, Philip Lowman wrote: >>> >>> When I invoke add_custom_target() in the >>> parent directory it causes an error in the makefiles. >> >> To me this appears to be a bug in the Makefile generator. I also tried to >> make a "untarFoo" custom target in test/CMakeLists.txt, which depended on >> the output of the custom command and then have the "untar" target depend on >> "untarFoo", but that didn't work out either. > > Custom commands are registered only in the directory where they appear. > When Philip points the DEPENDS of add_custom_target at a file, CMake looks > only at custom commands added in that directory for a rule. Since it > doesn't find one it assumes that the user is referring to a file that will > be on disk by the time the custom target builds. This isn't the case, so > make complains it can't find the file.
I'm kind of resurrecting this old thread, because I just ran into this issue and found no documentation on it in the CMake docs. I filed a documentation bug: http://public.kitware.com/Bug/view.php?id=8815 BTW, is there a particular reason why custom commands are only registered in the directory where they appear? They seem kind of like the little brother of a target, and targets are global. James _______________________________________________ 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
