Commit dd378258 authored by Brad King's avatar Brad King
Browse files

FindJava: Do not accept OS X stub 'java' as Java



OS X provides a stub 'java' to inform callers that Java is not present.
When checking the 'java -version' output, look for such a message and if
found pretend 'java' was not found.
Suggested-by: Sean McBride's avatarSean McBride <sean@rogue-research.com>
parent 54ff77dc
......@@ -115,7 +115,10 @@ if(Java_JAVA_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
if( res )
if(${Java_FIND_REQUIRED})
if(var MATCHES "No Java runtime present, requesting install")
set_property(CACHE Java_JAVA_EXECUTABLE
PROPERTY VALUE "Java_JAVA_EXECUTABLE-NOTFOUND")
elseif(${Java_FIND_REQUIRED})
message( FATAL_ERROR "Error executing java -version" )
else()
message( STATUS "Warning, could not run java -version")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment