summaryrefslogtreecommitdiffstats
path: root/Modules/FindJava.cmake
diff options
context:
space:
mode:
authorAmit Kulkarni <amitkulz@gmail.com>2012-12-03 23:23:10 (GMT)
committerBrad King <brad.king@kitware.com>2012-12-04 13:35:23 (GMT)
commit6e7a3453b43897006cdd1b2587a3641fe3bd7731 (patch)
treeb18634aa6ab08f3b7894d9fc9b75768cc43047fe /Modules/FindJava.cmake
parent288f75edee99d6689f6651fe2ad00955d293d665 (diff)
downloadCMake-6e7a3453b43897006cdd1b2587a3641fe3bd7731.zip
CMake-6e7a3453b43897006cdd1b2587a3641fe3bd7731.tar.gz
CMake-6e7a3453b43897006cdd1b2587a3641fe3bd7731.tar.bz2
OpenBSD: Add paths for Java 1.6.0/1.7.0 JRE/JDK
Diffstat (limited to 'Modules/FindJava.cmake')
-rw-r--r--Modules/FindJava.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 1b4593d..2f02b7a 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -80,6 +80,8 @@ set(_JAVA_PATHS
/usr/java/j2sdk1.4.2_09/bin
/usr/lib/j2sdk1.5-sun/bin
/opt/sun-jdk-1.5.0.04/bin
+ /usr/local/jdk-1.7.0/bin
+ /usr/local/jdk-1.6.0/bin
)
find_program(Java_JAVA_EXECUTABLE
NAMES java
@@ -107,6 +109,7 @@ if(Java_JAVA_EXECUTABLE)
# 2. OpenJDK 1.6
# 3. GCJ 1.5
# 4. Kaffe 1.4.2
+ # 5. OpenJDK 1.7.x on OpenBSD
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_.]+.*)\".*"
@@ -115,6 +118,10 @@ if(Java_JAVA_EXECUTABLE)
# Kaffe style
string( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*"
"\\1" Java_VERSION_STRING "${var}" )
+ elseif(var MATCHES "openjdk version \"[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
+ # OpenJDK ver 1.7.x on OpenBSD
+ string( REGEX REPLACE "openjdk version \"([0-9]+\\.[0-9]+\\.[0-9_]+).*"
+ "\\1" Java_VERSION_STRING "${var}" )
else()
if(NOT Java_FIND_QUIETLY)
message(WARNING "regex not supported: ${var}. Please report")