summaryrefslogtreecommitdiff
path: root/Modules/GoogleTest.cmake
diff options
context:
space:
mode:
authorAlessandro <alessandro.pezzato@gmail.com>2018-09-03 09:53:43 -0400
committerCraig Scott <craig.scott@crascit.com>2018-09-10 16:21:48 +0800
commit31c82143bfdb1d9bc5e6282f3341fc09a0ab2234 (patch)
tree3487cc4c469d39f8e65c9b6494fa22997007b0f5 /Modules/GoogleTest.cmake
parentd6b06d8d876a1cd240f347cdebe527354cb6fd2a (diff)
downloadcmake-31c82143bfdb1d9bc5e6282f3341fc09a0ab2234.tar.gz
GoogleTest: gtest_add_tests() fails if any source file is empty
Fixes #18321
Diffstat (limited to 'Modules/GoogleTest.cmake')
-rw-r--r--Modules/GoogleTest.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index 2c9ee1180d..a5bb863608 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})