summaryrefslogtreecommitdiffstats
path: root/config/cmake/FindJNI.cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-09-15 18:32:01 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-09-15 18:32:01 (GMT)
commit04634520cf0ee5ef0b9ef145822083b7b7eced2a (patch)
tree5a51f5871889452c0f524272380d4ac5e92c51bf /config/cmake/FindJNI.cmake
parent052efd9bde06ea2427beffd3ea493cbc53a17608 (diff)
downloadhdf5-04634520cf0ee5ef0b9ef145822083b7b7eced2a.zip
hdf5-04634520cf0ee5ef0b9ef145822083b7b7eced2a.tar.gz
hdf5-04634520cf0ee5ef0b9ef145822083b7b7eced2a.tar.bz2
Update CMake java functions
Diffstat (limited to 'config/cmake/FindJNI.cmake')
-rw-r--r--config/cmake/FindJNI.cmake31
1 files changed, 25 insertions, 6 deletions
diff --git a/config/cmake/FindJNI.cmake b/config/cmake/FindJNI.cmake
index 440a9889..9105f3d 100644
--- a/config/cmake/FindJNI.cmake
+++ b/config/cmake/FindJNI.cmake
@@ -63,7 +63,7 @@ macro(java_append_library_directories _var)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
set(_java_libarch "ppc64" "ppc")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
- set(_java_libarch "ppc")
+ set(_java_libarch "ppc" "ppc64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
# Both flavours can run on the same processor
set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
@@ -92,10 +92,14 @@ macro(java_append_library_directories _var)
if(_path MATCHES "{libarch}")
foreach(_libarch ${_java_libarch})
string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}")
- list(APPEND ${_var} "${_newpath}")
+ if(EXISTS ${_newpath})
+ list(APPEND ${_var} "${_newpath}")
+ endif()
endforeach()
else()
- list(APPEND ${_var} "${_path}")
+ if(EXISTS ${_path})
+ list(APPEND ${_var} "${_path}")
+ endif()
endif()
endforeach()
endmacro()
@@ -161,6 +165,10 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
/usr/lib/jvm/default-java/jre/lib/{libarch}
/usr/lib/jvm/default-java/jre/lib
/usr/lib/jvm/default-java/lib
+ # Ubuntu specific paths for default JVM
+ /usr/lib/jvm/java-8-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
+ /usr/lib/jvm/java-7-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
+ /usr/lib/jvm/java-6-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
# OpenBSD specific paths for default JVM
/usr/local/jdk-1.7.0/jre/lib/{libarch}
/usr/local/jre-1.7.0/lib/{libarch}
@@ -191,6 +199,9 @@ list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
+)
+
+JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_INCLUDE_DIRECTORIES
${_JAVA_HOME}/include
/usr/include
/usr/java/include
@@ -209,6 +220,9 @@ list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES
/usr/lib/jvm/java-7-openjdk-amd64/include
/usr/lib64/jvm/java-7-openjdk/include
/usr/lib64/jvm/java-7-openjdk-amd64/include
+ /usr/lib/jvm/java-8-openjdk-{libarch}/include # ubuntu 15.10
+ /usr/lib/jvm/java-7-openjdk-{libarch}/include # ubuntu 15.10
+ /usr/lib/jvm/java-6-openjdk-{libarch}/include # ubuntu 15.10
/usr/local/share/java/include
/usr/lib/j2sdk1.4-sun/include
/usr/lib/j2sdk1.5-sun/include
@@ -290,7 +304,8 @@ find_path(JAVA_INCLUDE_PATH jni.h
${JAVA_AWT_INCLUDE_DIRECTORIES}
)
-find_path(JAVA_INCLUDE_PATH2 jni_md.h
+find_path(JAVA_INCLUDE_PATH2 NAMES jni_md.h jniport.h
+ PATHS
${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH}/darwin
${JAVA_INCLUDE_PATH}/win32
@@ -300,6 +315,7 @@ find_path(JAVA_INCLUDE_PATH2 jni_md.h
${JAVA_INCLUDE_PATH}/solaris
${JAVA_INCLUDE_PATH}/hp-ux
${JAVA_INCLUDE_PATH}/alpha
+ ${JAVA_INCLUDE_PATH}/aix
)
find_path(JAVA_AWT_INCLUDE_PATH jawt.h
@@ -316,8 +332,11 @@ endif()
#include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
INCLUDE (FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
- JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY
+ JAVA_JVM_LIBRARY
+ JAVA_INCLUDE_PATH
+ JAVA_INCLUDE_PATH2
+ JAVA_AWT_INCLUDE_PATH)
mark_as_advanced(
JAVA_AWT_LIBRARY