On Monday 05 February 2007 6:47 pm, Alan W. Irwin wrote: > On 2007-02-05 15:58+0100 frederic heem wrote: > > Hi, > > It seems that ADD_DEPENDENCIES does not allow to add a dependency to > > every target. Here is a brief description of the problem: > > A subdirectory contains a custom target to generate html from a docbook: > > > > ADD_CUSTOM_TARGET(doc-test > > COMMAND xmlto html > > ${CMAKE_CURRENT_SOURCE_DIR}/doc/CallDocBook.xml > > COMMENT "generate the html documentation") > > > > Each sub-subdirectory has to generate a chapter of the docbook: > > > > ADD_CUSTOM_TARGET(testFoo > > COMMAND java -jar xalan.jar -in testFoo.xml -xsl > > test.xsl -out testFooDocBook.xml) > > ADD_DEPENDENCIES(doc-test testFoo) > > > > Unfortunately, cmake complains about ADD_DEPENDENCIES(doc-test testFoo): > > ADD_DEPENDENCIES Adding dependency to non-existent target: doc-test > > If ADD_DEPENDENCIES is commented, make help shows the doc-test target. > > Is there a way to overcome this problem ? > > The above order won't work (as you have found out), but I think you should > be okay if you do the commands in the following order: > > ADD_CUSTOM_TARGET(testFoo ...) > ADD_CUSTOM_TARGET(doc-test ...) > ADD_DEPENDENCIES(doc-test testFoo) > thanks for the tips, but unfortunately, that's not working as expected, running "make doc-test" results in testFoo1 doc-test testFoo2 doc-test testFoo3 doc-test etc ... The target doc-test shall run only once at the end when all target testFoon are executed.
> I use that pattern all the time even when the first command is done in > a separate subdirectory. > > Alan > __________________________ > Alan W. Irwin > > Astronomical research affiliation with Department of Physics and Astronomy, > University of Victoria (astrowww.phys.uvic.ca). > > Programming affiliations with the FreeEOS equation-of-state implementation > for stellar interiors (freeeos.sf.net); PLplot scientific plotting software > package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the > Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project > (lbproject.sf.net). > __________________________ > > Linux-powered Science > __________________________ > _______________________________________________ > CMake mailing list > CMake@cmake.org > http://www.cmake.org/mailman/listinfo/cmake _______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake