summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-25 13:38:01 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-11-25 13:38:06 (GMT)
commit52c8c4b8264d4d948b1540ce03317976e1439fcb (patch)
tree100fe404c9b53524eb0b7e65b9d68e2367502655 /Tests/CMakeLists.txt
parentac13652a7c695299fd342ce869903cafd94c4bd1 (diff)
parent1af2d1d0eac17ef87d75f1a4c6d480274c12d0b0 (diff)
downloadCMake-52c8c4b8264d4d948b1540ce03317976e1439fcb.zip
CMake-52c8c4b8264d4d948b1540ce03317976e1439fcb.tar.gz
CMake-52c8c4b8264d4d948b1540ce03317976e1439fcb.tar.bz2
Merge topic 'test-java-default'
1af2d1d0ea Tests: Add CMake_TEST_Java option to control Java tests Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5532
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt14
1 files changed, 11 insertions, 3 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 328ab7f..6a4a5c5 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -3318,9 +3318,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)