diff options
author | Zak Eckert <eckertzs1@gmail.com> | 2016-03-11 16:23:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-03-15 19:21:37 (GMT) |
commit | a5d3d003d0192f8d5fd87885f948338c04fc3f85 (patch) | |
tree | 1061a18c642a952b3d132d4c5e9cb377f385cda9 /Modules/FindGTest.cmake | |
parent | 1d4ab06a7045edf366c689ba5e29bbc35d08718e (diff) | |
download | CMake-a5d3d003d0192f8d5fd87885f948338c04fc3f85.zip CMake-a5d3d003d0192f8d5fd87885f948338c04fc3f85.tar.gz CMake-a5d3d003d0192f8d5fd87885f948338c04fc3f85.tar.bz2 |
FindGTest: Automatically re-run cmake when tests change
Tell CMake that it needs to re-run when test source files parsed by
`gtest_add_tests` change so that we can re-scan for tests automatically.
Diffstat (limited to 'Modules/FindGTest.cmake')
-rw-r--r-- | Modules/FindGTest.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index ca49e4a..a7ffcfe 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -82,8 +82,7 @@ # ``AUTO`` to find them from executable target # # However, note that this macro will slow down your tests by running -# an executable for each test and test fixture. You will also have to -# re-run CMake after adding or removing tests or test fixtures. +# an executable for each test and test fixture. # # Example usage:: # @@ -119,6 +118,7 @@ function(GTEST_ADD_TESTS executable extra_args) set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*") set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)") foreach(source ${ARGN}) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source}) file(READ "${source}" contents) string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents}) foreach(hit ${found_tests}) |