CMake Java Support
At the end of last year I’ve worked on Dogtag PKI, which is enterprise-class open source Certificate Authority.
The project is written in serveral different laguages (C, C++ and Java), so I’ve used CMake as the new build system. I know CMake very well and use it since a long time. To be able to build the java project I needed Java support in CMake. The current support is broken and after talking to Bill Hoffman he suggested to write CMake functions. So I’ve started to write functions to compile java files, find jar files, bundle jar files and generate javadoc.
My Java support for CMake should provide everything you need to build java and jni projects. You find the files here:
Find JNI libraries and headers. I think this is the file from CMake itself.
Find all needed Java tools like javac, javadoc, jar, etc.
This file provides all needed function to support creating java projects in CMake. Most of the function are documented in detail. There is some documentation missing. I will try to add it soon.
This is needed to find the class files in the build directory. One .java file can create multiple .class files. So you have to glob for these file. There is support to only look for certain .class files.
This is a helper to create symlinks for versioned jar files.
To checkout the tree use:
git clone git://git.cryptomilk.org/projects/cmake-tools.git
It would be nice if this would be included into the CMake distribution, but at
the moment there is still documentation missing. I hope that this will help
some people to get their Java project built with CMake.
Comments, suggestions and patches are welcome!
This work is upstream and will be available with CMake 2.8.6 (September 2011).