diff options
Diffstat (limited to 'Tests')
-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) |