summaryrefslogtreecommitdiffstats
path: root/Modules/FindJava.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2012-06-25 16:53:53 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2012-06-25 16:53:53 (GMT)
commit304562e7b51d17735f8e8980e028a00d88b6d1ea (patch)
tree49d434e3fcded5e00608f32ad3a5526591234c73 /Modules/FindJava.cmake
parenteb0922a90c783ad3546ec8f43cc54864fae1ef1f (diff)
downloadCMake-304562e7b51d17735f8e8980e028a00d88b6d1ea.zip
CMake-304562e7b51d17735f8e8980e028a00d88b6d1ea.tar.gz
CMake-304562e7b51d17735f8e8980e028a00d88b6d1ea.tar.bz2
FindJava: improve version matching (#12878)
Diffstat (limited to 'Modules/FindJava.cmake')
-rw-r--r--Modules/FindJava.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 34a7077..3457021 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -107,9 +107,9 @@ IF(Java_JAVA_EXECUTABLE)
# 2. OpenJDK 1.6
# 3. GCJ 1.5
# 4. Kaffe 1.4.2
- IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+[oem-]*\".*")
+ IF(var MATCHES "java version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
# This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
- STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+)[oem-]*\".*"
+ STRING( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*"
"\\1" Java_VERSION_STRING "${var}" )
ELSEIF(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
# Kaffe style
@@ -124,7 +124,7 @@ IF(Java_JAVA_EXECUTABLE)
STRING( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
# warning tweak version can be empty:
- STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+\\_?\\.?([0-9]*)$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
+ STRING( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined
set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH})
else( )