[Cmake-commits] CMake branch, master, updated. 0d88e19fefd44d3c243f010f5226f62c34b78b1f
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue May 11 16:48:41 EDT 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 0d88e19fefd44d3c243f010f5226f62c34b78b1f (commit)
from 9c0937f8c2df63745bfe63db699a0edcb71950f3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d88e19fefd44d3c243f010f5226f62c34b78b1f
commit 0d88e19fefd44d3c243f010f5226f62c34b78b1f
Author: Mathieu Malaterre <mathieu.malaterre at gmail.com>
Date: Sun May 9 14:41:15 2010 +0200
BUG: 0009840 Fix case when only Java is available by implementing COMP Runtime
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 9e2a640..4cd4389 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -24,9 +24,18 @@
# and
# Java_VERSION = 1.6.0
#
-# NOTE: At the moment this script will look for javac and jar component,
-# which means it will fail if javac or jar is not found.:w
-# See Bug #9840
+# For these components the following variables are set:
+#
+# Java_FOUND - TRUE if all components are found.
+# Java_INCLUDE_DIRS - Full paths to all include dirs.
+# Java_LIBRARIES - Full paths to all libraries.
+# Java_<component>_FOUND - TRUE if <component> is found.
+#
+# Example Usages:
+# FIND_PACKAGE(Java)
+# FIND_PACKAGE(Java COMPONENTS Runtime)
+# FIND_PACKAGE(Java COMPONENTS Development)
+#
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
@@ -152,12 +161,36 @@ FIND_PROGRAM(Java_JAVAC_EXECUTABLE
)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Java DEFAULT_MSG
- Java_JAVA_EXECUTABLE
- Java_JAR_EXECUTABLE
- Java_JAVAC_EXECUTABLE
- _java_version_acceptable
-)
+if(Java_FIND_COMPONENTS)
+ foreach(component ${Java_FIND_COMPONENTS})
+ # User just want to execute some Java byte-compiled
+ if(component STREQUAL "Runtime")
+ find_package_handle_standard_args(Java DEFAULT_MSG
+ Java_JAVA_EXECUTABLE
+ _java_version_acceptable
+ )
+ elseif(component STREQUAL "Development")
+ find_package_handle_standard_args(Java DEFAULT_MSG
+ Java_JAVA_EXECUTABLE
+ Java_JAR_EXECUTABLE
+ Java_JAVAC_EXECUTABLE
+ _java_version_acceptable
+ )
+ else()
+ message(FATAL_ERROR "Comp: ${component} is not handled")
+ endif()
+ set(Java_${component}_FOUND TRUE)
+ endforeach(component)
+else()
+ # Check for everything
+ find_package_handle_standard_args(Java DEFAULT_MSG
+ Java_JAVA_EXECUTABLE
+ Java_JAR_EXECUTABLE
+ Java_JAVAC_EXECUTABLE
+ _java_version_acceptable
+ )
+endif()
+
MARK_AS_ADVANCED(
Java_JAVA_EXECUTABLE
-----------------------------------------------------------------------
Summary of changes:
Modules/FindJava.cmake | 51 +++++++++++++++++++++++++++++++++++++++--------
1 files changed, 42 insertions(+), 9 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list