From 31c82143bfdb1d9bc5e6282f3341fc09a0ab2234 Mon Sep 17 00:00:00 2001 From: Alessandro Date: Mon, 3 Sep 2018 09:53:43 -0400 Subject: GoogleTest: gtest_add_tests() fails if any source file is empty Fixes #18321 --- Modules/GoogleTest.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake index 2c9ee11..a5bb863 100644 --- a/Modules/GoogleTest.cmake +++ b/Modules/GoogleTest.cmake @@ -308,7 +308,7 @@ function(gtest_add_tests) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source}) endif() file(READ "${source}" contents) - string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents}) + string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests "${contents}") foreach(hit ${found_tests}) string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit}) -- cgit v0.12