You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[gtest] fix cppinterop testing with builtin_gtest (#22469)
When builtin_gtest is used, one should export defined include paths to PARENT_SCOPE
And like with many other builtins, instead of silent switch to builtin version of package - produce for gtest error message and force user explicitly specify `-Dbuiltin_gtest=ON`
Add extra argument to ROOT_FIND_REQUIRED_DEP macro to specify minimal version.
#---Check for googletest---------------------------------------------------------------
1248
1255
if (testing OR testsupport)
1249
-
if (NOT builtin_gtest)
1250
-
if(fail-on-missing)
1251
-
find_package(GTest1.10REQUIRED)
1252
-
else()
1253
-
find_package(GTest1.10)
1254
-
if(NOT GTEST_FOUND)
1255
-
ROOT_CHECK_CONNECTION("testing=OFF")
1256
-
if(NO_CONNECTION)
1257
-
message(STATUS"GTest not found, and no internet connection. Disabling the 'testing' and 'testsupport' options.")
1258
-
set(testing OFFCACHEBOOL"Disabled because testing requested and GTest not found (${builtin_gtest_description}) and there is no internet connection"FORCE)
1259
-
set(testsupport OFFCACHEBOOL"Disabled because testsupport requested and GTest not found (${builtin_gtest_description}) and there is no internet connection"FORCE)
1260
-
else()
1261
-
message(STATUS"GTest not found, switching ON 'builtin_gtest' option.")
1262
-
set(builtin_gtest ONCACHEBOOL"Enabled because testing requested and GTest not found (${builtin_gtest_description})"FORCE)
1263
-
endif()
1264
-
endif()
1265
-
endif()
1266
-
else()
1256
+
if (builtin_gtest)
1267
1257
ROOT_CHECK_CONNECTION("testing=OFF")
1268
1258
if(NO_CONNECTION)
1269
1259
message(STATUS"No internet connection, disabling the 'testing', 'testsupport' and 'builtin_gtest' options")
1270
1260
set(testing OFFCACHEBOOL"Disabled because there is no internet connection"FORCE)
1271
1261
set(testsupport OFFCACHEBOOL"Disabled because there is no internet connection"FORCE)
1272
1262
set(builtin_gtest OFFCACHEBOOL"Disabled because there is no internet connection"FORCE)
1263
+
else()
1264
+
add_subdirectory(builtins/gtest)
1273
1265
endif()
1274
1266
endif()
1275
1267
endif()
1276
1268
1277
-
if (builtin_gtest)
1278
-
add_subdirectory(builtins/gtest)
1269
+
if (testing OR testsupport)
1270
+
# Starting from cmake 3.23, the GTest targets will have stable names.
1271
+
# ROOT was updated to use those, but for older CMake versions, we have to declare the aliases:
0 commit comments