[CMake] CMake Java Support

Andreas Schneider asn at redhat.com
Fri Jan 14 10:06:37 EST 2011


On Wednesday 12 January 2011 15:32:08 Allen D Byrne wrote:
> Andreas,

Hi Allen,

> Thanks for providing these files! I have finally been able to progress on
> converting our java product to cmake. I have one suggestion:
> 
> Add to the add_java function the classpath for the target;
> 
>     set(${_TARGET_NAME}_CLASSPATH
> ".${CMAKE_JAVA_INCLUDE_PATH_FINAL}/${_TARGET_NAME}.jar" PARENT_SCOPE)

You should use an absolute path here if it isn't one yet. But the . at the 
beginning look suspicous :)

Do you want to create a patch for that?
 
> I needed this on linux (uses ':' in classpath not ';' ) to do an add_test.
> 
> Also two questions:
> How do I get the jar files into an output folder for build/test (not
> install task)?

I think we would need to support this. We could support EXECUTABLE_OUTPUT_PATH 
if it is set. Then you copy the jar file to this directory too.

> After I build my JNI Library with normal C process how do I connect the
> java JAR  to use the library? I'm not sure how to use INSTALL_JNI_SYMLINK?

You need to set a version, else it will not work.


Cheers,


	-- andreas

-- 
Andreas Schneider                   GPG-ID: 8B7EB4B8
Red Hat                               asn at redhat.com
Samba Team                             asn at samba.org


More information about the CMake mailing list