JNI: Fix JNI detection on macOS
Before this commit the JNI plugin would not be included on macOS, if
`JAVA_HOME` was not set properly.
include (LibAddMacros)
if (DEPENDENCY_PHASE)
+ if (APPLE)
+ execute_process (COMMAND "/usr/libexec/java_home" OUTPUT_VARIABLE JAVA_HOME)
+ string (STRIP ${JAVA_HOME} JAVA_HOME)
+ endif ()
+
find_package (JNI)
if (JNI_FOUND)
