diff options
author | Brad King <brad.king@kitware.com> | 2020-11-24 17:19:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-24 18:29:30 (GMT) |
commit | 1af2d1d0eac17ef87d75f1a4c6d480274c12d0b0 (patch) | |
tree | 95aadf3df64204154ac9b3a3c06d9140f270360e /Tests/CMakeLists.txt | |
parent | 64fb825438a2fecb9eab9933d5d1b926bf6f294b (diff) | |
download | CMake-1af2d1d0eac17ef87d75f1a4c6d480274c12d0b0.zip CMake-1af2d1d0eac17ef87d75f1a4c6d480274c12d0b0.tar.gz CMake-1af2d1d0eac17ef87d75f1a4c6d480274c12d0b0.tar.bz2 |
Tests: Add CMake_TEST_Java option to control Java tests
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 9aa401d..10406e3 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -3326,9 +3326,17 @@ if(BUILD_TESTING) endif() endif() - find_package(Java COMPONENTS Development QUIET) - if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW - AND NOT "${CMAKE_GENERATOR}" MATCHES "Xcode") + if(NOT DEFINED CMake_TEST_Java) + if(APPLE OR MINGW) + set(CMake_TEST_Java 0) + else() + set(CMake_TEST_Java 1) + endif() + endif() + if(CMake_TEST_Java) + find_package(Java COMPONENTS Development QUIET) + endif() + if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE) set(JavaExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}) ADD_TEST_MACRO(JavaExportImport JavaExportImport) |