summaryrefslogtreecommitdiffstats
path: root/Modules/FindJNI.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-07-20 19:39:02 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2008-07-20 19:39:02 (GMT)
commitf889f9e35fdf113cc7a233a17ecad13286e77a16 (patch)
treea9a72dd5d5e7747bfd17d5be41c07987fdc6098d /Modules/FindJNI.cmake
parent75e6fe05796e98de8b423d8fcd35abb4043e0573 (diff)
downloadCMake-f889f9e35fdf113cc7a233a17ecad13286e77a16.zip
CMake-f889f9e35fdf113cc7a233a17ecad13286e77a16.tar.gz
CMake-f889f9e35fdf113cc7a233a17ecad13286e77a16.tar.bz2
BUG: fix #6416: provide JNI_LIBRARIES and JNI_INCLUDE_DIRS
Alex
Diffstat (limited to 'Modules/FindJNI.cmake')
-rw-r--r--Modules/FindJNI.cmake23
1 files changed, 20 insertions, 3 deletions
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index 26f4734..0c95b38 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -3,14 +3,18 @@
# include files and libraries are. It also determines what the name of
# the library is. This code sets the following variables:
#
-# JAVA_AWT_LIB_PATH = the path to the jawt library
-# JAVA_JVM_LIB_PATH = the path to the jvm library
+# JNI_INCLUDE_DIRS = the include dirs to use
+# JNI_LIBRARIES = the libraries to use
+# JAVA_AWT_LIBRARY = the path to the jawt library
+# JAVA_JVM_LIBRARY = the path to the jvm library
# JAVA_INCLUDE_PATH = the include path to jni.h
# JAVA_INCLUDE_PATH2 = the include path to jni_md.h
# JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
-#
+#
+
GET_FILENAME_COMPONENT(java_install_version
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME)
+
SET(JAVA_AWT_LIBRARY_DIRECTORIES
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib"
@@ -32,6 +36,7 @@ SET(JAVA_AWT_LIBRARY_DIRECTORIES
/usr/lib/j2sdk1.4-sun/jre/lib/amd64
/usr/lib/j2sdk1.5-sun/jre/lib/amd64
)
+
SET(JAVA_JVM_LIBRARY_DIRECTORIES)
FOREACH(dir ${JAVA_AWT_LIBRARY_DIRECTORIES})
SET(JAVA_JVM_LIBRARY_DIRECTORIES
@@ -144,3 +149,15 @@ MARK_AS_ADVANCED(
JAVA_INCLUDE_PATH
JAVA_INCLUDE_PATH2
)
+
+SET(JNI_LIBRARIES
+ ${JAVA_AWT_LIBRARY}
+ ${JAVA_JVM_LIBRARY}
+)
+
+SET(JNI_INCLUDE_DIRS
+ ${JAVA_INCLUDE_PATH}
+ ${JAVA_INCLUDE_PATH2}
+ ${JAVA_AWT_INCLUDE_PATH}
+)
+