summaryrefslogtreecommitdiff
path: root/Modules/FindJava.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2010-04-25 16:05:21 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2010-04-25 16:05:21 -0400
commit0da537d16792ffcc38ec1fb19d518900b1fe7432 (patch)
tree25579b9407ef05af49533e69ff6bd13f82e2a12d /Modules/FindJava.cmake
parent70f90787806f92ce38172c465eab76cc8a915aba (diff)
downloadcmake-0da537d16792ffcc38ec1fb19d518900b1fe7432.tar.gz
Do not error out if the java version is not found, if java is not required.
Diffstat (limited to 'Modules/FindJava.cmake')
-rw-r--r--Modules/FindJava.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 7eb6d900c5..9e2a640950 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -82,7 +82,11 @@ IF(Java_JAVA_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
IF( res )
- MESSAGE( FATAL_ERROR "Error executing java -version" )
+ IF(${Java_FIND_REQUIRED})
+ MESSAGE( FATAL_ERROR "Error executing java -version" )
+ ELSE()
+ MESSAGE( STATUS "Warning, could not run java --version")
+ ENDIF()
ELSE()
# extract major/minor version and patch level from "java -version" output
# Tested on linux using