[cmake-developers] Java support

CHEVRIER, Marc marc.chevrier at sap.com
Wed Aug 5 03:15:00 EDT 2015


Hi,

For point 1. I completely forgot to test with VS generators… I will work on that ASAP.
For point 2., The best approach is to install 32 and 64bit versions of Java SDK (Windows versions, not some cygwin or MSYS versions) and ensure JAVA_HOME is NOT set in the environment nor referenced in the PATH. In this case, CMake FindJava.cmake module will look at the registry to retrieve the correct java version.





Marc

On 04/08/15 17:42, "Brad King" <brad.king at kitware.com> wrote:

>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