summaryrefslogtreecommitdiffstats
path: root/cmake/Modules/CMakeTestJavaCompiler.cmake
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-03-24 02:27:47 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-03-26 11:43:54 -0500
commit621d9e5c413e561293d7484b93882d985b3fe15f (patch)
tree638f3d75761c121d9a8fb50b52a12a6686c5ac5c /cmake/Modules/CMakeTestJavaCompiler.cmake
parent40d3643b8d91886bf210aa27f711731c81a11e49 (diff)
downloadpki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.gz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.xz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.zip
Removed unnecessary pki folder.
Previously the source code was located inside a pki folder. This folder was created during svn migration and is no longer needed. This folder has now been removed and the contents have been moved up one level. Ticket #131
Diffstat (limited to 'cmake/Modules/CMakeTestJavaCompiler.cmake')
-rw-r--r--cmake/Modules/CMakeTestJavaCompiler.cmake47
1 files changed, 47 insertions, 0 deletions
diff --git a/cmake/Modules/CMakeTestJavaCompiler.cmake b/cmake/Modules/CMakeTestJavaCompiler.cmake
new file mode 100644
index 000000000..e524bc251
--- /dev/null
+++ b/cmake/Modules/CMakeTestJavaCompiler.cmake
@@ -0,0 +1,47 @@
+#=============================================================================
+# Copyright 2004-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This file is used by EnableLanguage in cmGlobalGenerator to
+# determine that that selected Java compiler can actually compile
+# and link the most basic of programs. If not, a fatal error
+# is set and cmake stops processing commands and will not generate
+# any makefiles or projects.
+
+set(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "")
+
+if (NOT CMAKE_Java_COMPILER_WORKS)
+ message(STATUS "Check for working Java compiler: ${CMAKE_Java_COMPILER}")
+
+ file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testJavaCompiler.java
+ "class HelloWorldApp {\n"
+ " public static void main(String[] args) {\n"
+ " System.out.println("Hello World!");\n"
+ " }\n"
+ "}\n"
+ )
+
+ try_compile(CMAKE_Java_COMPILER_WORKS
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testJavaCompiler.java
+ OUTPUT_VARIABLE OUTPUT
+ )
+
+ if (CMAKE_Java_COMPILER_WORKS)
+ message(STATUS "Check for working Java compiler: ${CMAKE_C_COMPILER} -- works")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if the C compiler works passed with "
+ "the following output:\n${OUTPUT}\n\n"
+ )
+ set(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "")
+ endif (CMAKE_Java_COMPILER_WORKS)
+endif (NOT CMAKE_Java_COMPILER_WORKS)