summaryrefslogtreecommitdiff
path: root/Modules/FindJNI.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-29 13:47:51 -0500
committerBrad King <brad.king@kitware.com>2014-01-29 14:12:54 -0500
commitfcd66a7f7b944f95372386332381a11c3b8b1508 (patch)
treea671843df379c3e68a384e6265dddf2ca9bb1a55 /Modules/FindJNI.cmake
parent4b3614b25a10bf558b3687cee5bac012779866e3 (diff)
downloadcmake-fcd66a7f7b944f95372386332381a11c3b8b1508.tar.gz
Find{Java,JNI}: Consider JAVA_HOME before ENV{JAVA_HOME}
Add a helper module CMakeFindJavaCommon shared between FindJava and FindJNI to select a JAVA_HOME value. Prefer a CMake variable or cache entry first, then an environment variable.
Diffstat (limited to 'Modules/FindJNI.cmake')
-rw-r--r--Modules/FindJNI.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index aef28d1912..ccb51910a9 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -6,7 +6,10 @@
#
# This module finds if Java is installed and determines where the
# include files and libraries are. It also determines what the name of
-# the library is. This code sets the following variables:
+# the library is. The caller may set variable JAVA_HOME to specify a
+# Java installation prefix explicitly.
+#
+# This module sets the following result variables:
#
# ::
#
@@ -91,7 +94,7 @@ macro(java_append_library_directories _var)
endforeach()
endmacro()
-file(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
set(JAVA_AWT_LIBRARY_DIRECTORIES)
if(_JAVA_HOME)