[cmake-developers] Java support

Brad King brad.king at kitware.com
Tue Aug 4 11:42:32 EDT 2015


On 08/04/2015 04:45 AM, CHEVRIER, Marc wrote:
> Attached is a new version of patch 4 tested successfully
> on Linux (SuSE 11.3), Windows (7 64bit) and MacOS (10.10.4)

Thanks.  This still fails for me on Windows with a VS generator
for two reasons:

1.  The java.library.path setting points at the build directory
    but not at the per-configuration subdirectory in which VS
    generators place the .dll file.  I was able to hack around
    this locally by extending Tests/Java/CMakeLists.txt with:

        set_property(TARGET B PROPERTY RUNTIME_OUTPUT_DIRECTORY_DEBUG .)

    though more work may be needed to work with other configs.

2.  With the above hack it still fails because java produces
    32-bit binaries but I was using a 64-bit toolchain so the
    plugin cannot load.

How are we to control the architecture for which java compiles?

Meanwhile I revised the other three commits:

 FindJava: Add support for idlj and jarsigner tools
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e72806fb

 UseJava: Teach add_jar to support file syntax for sources
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d287de4

 UseJava: Teach install_jar new DESTINATION and COMPONENT options
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cc23f0e9

We need to run the tests each in their own build tree or they
try to clobber each other during parallel testing.

-Brad


More information about the cmake-developers mailing list