diff options
| author | asn <asn@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-10-19 17:43:21 +0000 |
|---|---|---|
| committer | asn <asn@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-10-19 17:43:21 +0000 |
| commit | 93d5b168b53086d4d48ed763c3255b290d31d972 (patch) | |
| tree | 9858a6990f8e92f7adf109f3d540547368f46c70 /pki/cmake/Modules/CMakeTestJavaCompiler.cmake | |
| parent | b62e915deca1b81ba641d4ac907f03108eac3959 (diff) | |
| download | pki-93d5b168b53086d4d48ed763c3255b290d31d972.tar.gz pki-93d5b168b53086d4d48ed763c3255b290d31d972.tar.xz pki-93d5b168b53086d4d48ed763c3255b290d31d972.zip | |
Added initial files to build with CMake.
This is a start to introduce the CMake build system in pki. These are
the minimum requirements.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1361 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/cmake/Modules/CMakeTestJavaCompiler.cmake')
| -rw-r--r-- | pki/cmake/Modules/CMakeTestJavaCompiler.cmake | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/pki/cmake/Modules/CMakeTestJavaCompiler.cmake b/pki/cmake/Modules/CMakeTestJavaCompiler.cmake new file mode 100644 index 00000000..e524bc25 --- /dev/null +++ b/pki/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) |
