[Cmake] Why does ADD_JAVA_LIBRARY use "*.class" to build JAR files?

William A. Hoffman billlist at nycap.rr.com
Tue Aug 31 08:04:01 EDT 2004


Thanks for the patch, I will look into merging it.  In the future the best place
to add patches is via the bug tracker (www.cmake.org/Bug).  Just add the bug, then
go back and add the patch as an attachment to the bug.

-Bill


At 05:00 PM 8/30/2004, Doug Gregor wrote:
>I'm attempting to build some Jar files like this:
>
>ADD_JAVA_LIBRARY(bgl
>            edu/iu/osl/bgl/Graph.java edu/iu/osl/bgl/GraphMLPersister.java)
>
>The intent is to have the .class files stored in the Jar file to reflect the package hierarchy (so the class edu.iu.osl.bgl.Graph is in edu/iu/osl/bgl/Graph.class), as is common in Java. There are two problems here:
>        1) ADD_JAVA_LIBRARY can't cope with the paths in several ways, most importantly because it creates the Jar file from "*.class" instead of the actual set of targets
>        2) Only the first file is actually compiled, because the macro doesn't deal with a variable number of arguments
>
>The attached patch (against CMake 2.0.3) fixes these problems, so that the resulting Jar file has the right class files in the right places, e.g.:
>
>hoopy:~/Projects/parallel_bgl/IVC/build/src dgregor$ jar tf bgl.jar
>META-INF/
>META-INF/MANIFEST.MF
>edu/iu/osl/bgl/Graph.class
>edu/iu/osl/bgl/GraphMLPersister.class
>
>I was a little surprised to see that CMAKE_JAVA_ARCHIVE and CMAKE_JAVA_RUNTIME weren't marked as advanced options.
>
>        Doug
>
>
>
>
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake



More information about the Cmake mailing list