diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index a3bd904663cbf..9b9ed36cd00f1 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -557,14 +557,10 @@ set(CPPINTEROP_USE_CLING ON CACHE BOOL "" FORCE) set(CPPINTEROP_USE_REPL OFF CACHE BOOL "" FORCE) #---Disable testing on InterOp if ROOT's testing is OFF (InterOp tests are enabled by default) ------------------------------------------------------- -ROOT_CHECK_CONNECTION("CPPINTEROP_ENABLE_TESTING=OFF") -if(testing AND NOT NO_CONNECTION) - set(CPPINTEROP_ENABLE_TESTING ON CACHE BOOL "" FORCE) +if(testing) + set(CPPINTEROP_ENABLE_TESTING ON CACHE BOOL "Enable gtest in CppInterOp") else() - if(NO_CONNECTION) - message(STATUS "No internet connection, disabling the `CppInterOp testing infrastructure` option") - endif() - set(CPPINTEROP_ENABLE_TESTING OFF CACHE BOOL "") + set(CPPINTEROP_ENABLE_TESTING OFF CACHE BOOL "Enable gtest in CppInterOp") endif() add_subdirectory(CppInterOp) diff --git a/interpreter/CppInterOp/unittests/CMakeLists.txt b/interpreter/CppInterOp/unittests/CMakeLists.txt index f13b85f68f497..3d13205b52aa6 100644 --- a/interpreter/CppInterOp/unittests/CMakeLists.txt +++ b/interpreter/CppInterOp/unittests/CMakeLists.txt @@ -4,7 +4,11 @@ enable_testing() # LLVM builds (not installed llvm) provides gtest. if (NOT TARGET GTest::gtest AND NOT TARGET gtest) - include(GoogleTest) + find_package(GTest) + if (NOT GTest_FOUND) + message(WARNING "CppInterOp could not find GTest. Provide the package or set CPPINTEROP_ENABLE_TESTING=OFF to disable this warning.") + return() + endif() endif() if(EMSCRIPTEN)