summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab/ci/configure_macos_common.cmake4
-rw-r--r--Tests/CMakeLists.txt14
2 files changed, 12 insertions, 6 deletions
diff --git a/.gitlab/ci/configure_macos_common.cmake b/.gitlab/ci/configure_macos_common.cmake
index 3d09779..4bd3c7d 100644
--- a/.gitlab/ci/configure_macos_common.cmake
+++ b/.gitlab/ci/configure_macos_common.cmake
@@ -2,9 +2,7 @@
# detect that Java is available and working, but a test machine then not have a
# working Java installed. To work around this, just act as if Java is not
# available on any CI machine.
-set(Java_JAVA_EXECUTABLE "" CACHE FILEPATH "")
-set(Java_JAVAC_EXECUTABLE "" CACHE FILEPATH "")
-set(Java_JAR_EXECUTABLE "" CACHE FILEPATH "")
+set(CMake_TEST_Java 0 CACHE FILEPATH "")
# Qt binaries get placed inside the source directory, which causes them to not
# be included in the install-time rpath, but we still want them in the
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)