summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBryan Donlan <bdonlan@amazon.com>2017-05-03 21:40:08 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-04 14:49:17 (GMT)
commitf5a3ec4d76f24e15995d70736f671fa55c1ee798 (patch)
tree791dc559f944b38925116ccbc2415f8723041bae /Modules
parent84d0841ed7d06779b68a3950054b636f6ef4af74 (diff)
downloadCMake-f5a3ec4d76f24e15995d70736f671fa55c1ee798.zip
CMake-f5a3ec4d76f24e15995d70736f671fa55c1ee798.tar.gz
CMake-f5a3ec4d76f24e15995d70736f671fa55c1ee798.tar.bz2
FindJava: Add support for OpenJDK early access builds
OpenJDK 9 early access builds use a version string of "9-ea", and locally built installations use "9-internal", neither of which is currently accepted by the FindJava macro. Map those versions to "1.9". If the final released version is "9.0" the version interpretation could be changed to match at that time.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindJava.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 4265a97..3d32560 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -143,6 +143,9 @@ if(Java_JAVA_EXECUTABLE)
if(var MATCHES "java version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\"")
# This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
+ elseif(var MATCHES "openjdk version \"([0-9]+)-[a-z]+\"")
+ # OpenJDK 9 early access builds or locally built
+ set(Java_VERSION_STRING "1.${CMAKE_MATCH_1}.0")
elseif(var MATCHES "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+)\"")
# Kaffe style
set(Java_VERSION_STRING "${CMAKE_MATCH_1}")