On 2006-12-05 17:21-0000 Andrew Ross wrote: > > While testing the latest version of plplot I noticed that the dependencies > for the java library plplot.jar are not right. I've partially fixed it, > but I'd like some cmake advice on the complete fix. > > It's somewhat complicated because of bugs in some versions of jar we have > to make the whole library in one go, even though it contains files compiled > in bindings/java and examples/java. > > In bindings/java/CMakeLists.txt we have a custom target plplot_core > which depends on the relevant .class files and a custom command to build > each .class file from the equivalent .java file. > > In examples/java/CMakeLists.txt we have an equivalent custom target > plplot_examples. These work fine and the .class files are updated if the > .java files change. > > Also in example/java/CMakeLists.txt are a custom command to create > plplot.jar and a custom target (plplot.jar) which depends on > ${CMAKE_CURRENT_BINARY_DIR}/plplot.jar and also has dependencies on the > targets plplot_core and plplot_examples. > > Calling this appears to correctly call the targets plplot_core and > plplot_examples, which in turn update the classes. The .jar file is not > updated though. I think what is missing is a dependency of > ${CMAKE_CURRENT_BINARY_DIR}/plplot.jar on all the .class files.
I am a little concerned about the coincidence in names between your custom command OUTPUT file and your custom target. That would have caused a problem for 2.4.4 with exactly the symptoms you see (nothing happens), but that bug has apparently been fixed in 2.4.5. Just to be sure, though, you should temporarily rename your custom target plplot.jar to something else. How about solving this by creating the jar file every time (by dropping the custom command with the OUTPUT plplot.jar and putting the equivalent commands in the plplot.jar target)? My impression is that creating jar files is a fast process so the user probably wouldn't even notice the extra time this would take. Also, before going too much further with this you should see whether cross-directory file DEPENDS actually work. When I was just starting to work with cmake, I could never get that to work, but it may have been my inexperience or a bug in the earlier version of cmake. On the other hand, cmake may just not allow cross-directory file DEPENDS in which case we are back to the solution I proposed above to create the jar file every time you run make. I have some suggestions on alternatives for creating cross-directory DEPENDS file lists, but depending on your response to the questions and comments above we may not need them. 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 __________________________ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel