Hi,

This is a followup to this issue [0] and this pull request [1], relating to
finding Java and JNI on Mac.

After the commits noted here [2], I have found several issues:

* FindJava.cmake *

CMAKE_FIND_FRAMEWORK=FIRST|ONLY is ignored; only finds framework's
executable if JAVA_HOME is defined.

* FindJNI.cmake *

Defining a framework path for JAVA_HOME fails to find anything
  patch: https://gist.github.com/dakcarto/8789774

That patch just sniffs whether the defined framework is an Apple install,
i.e. has a 'bundle' symlink. I added a pattern match for '.framework', but
don't know if that is a proper solution for other platforms that utilize
frameworks, though.

When framework is preferred or defined, module now returns:

    JNI_LIBRARIES=
/System/Library/Frameworks/JavaVM.framework;/System/Library/Frameworks/JavaVM.framework
    JAVA_AWT_LIBRARY= /System/Library/Frameworks/JavaVM.framework
    JAVA_JVM_LIBRARY= /System/Library/Frameworks/JavaVM.framework

previously this was:

    JNI_LIBRARIES= -framework JavaVM;-framework JavaVM
    JAVA_AWT_LIBRARY= -framework JavaVM
    JAVA_JVM_LIBRARY= -framework JavaVM

Does this matter for frameworks? Seems like it should continue returning
the previous LDFLAGS results.

CMakeLists.txt for testing both modules (contains custom CMAKE_MODULE_PATH):
https://gist.github.com/dakcarto/8329063

[0] http://www.cmake.org/Bug/view.php?id=14689
[1] https://github.com/Kitware/CMake/pull/80
[2] https://github.com/Kitware/CMake/pull/80#issuecomment-33621209

Regards,

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota
-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to