summaryrefslogtreecommitdiffstats
path: root/Modules/FindJava.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-29 18:47:51 (GMT)
committerBrad King <brad.king@kitware.com>2014-01-29 19:12:54 (GMT)
commitfcd66a7f7b944f95372386332381a11c3b8b1508 (patch)
treea671843df379c3e68a384e6265dddf2ca9bb1a55 /Modules/FindJava.cmake
parent4b3614b25a10bf558b3687cee5bac012779866e3 (diff)
downloadCMake-fcd66a7f7b944f95372386332381a11c3b8b1508.zip
CMake-fcd66a7f7b944f95372386332381a11c3b8b1508.tar.gz
CMake-fcd66a7f7b944f95372386332381a11c3b8b1508.tar.bz2
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/FindJava.cmake')
-rw-r--r--Modules/FindJava.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 36624a4..a488c46 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -5,8 +5,10 @@
# Find Java
#
# This module finds if Java is installed and determines where the
-# include files and libraries are. This code sets the following
-# variables:
+# include files and libraries are. The caller may set variable JAVA_HOME
+# to specify a Java installation prefix explicitly.
+#
+# This module sets the following result variables:
#
# ::
#
@@ -67,7 +69,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-file(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _JAVA_HOME)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
# The HINTS option should only be used for values computed from the system.
set(_JAVA_HINTS)