summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorEero Aaltonen <eero.aaltonen@iki.fi>2021-10-17 14:13:07 (GMT)
committerBrad King <brad.king@kitware.com>2021-11-22 16:23:39 (GMT)
commit50bf457a0dd857cf976b22c5be7d333493233d1e (patch)
treeee03ca12b04b33a09e78d465a82d375dc04be00f /Tests
parenteb9991ad62666649b0349b8c1e88255330c1c05c (diff)
downloadCMake-50bf457a0dd857cf976b22c5be7d333493233d1e.zip
CMake-50bf457a0dd857cf976b22c5be7d333493233d1e.tar.gz
CMake-50bf457a0dd857cf976b22c5be7d333493233d1e.tar.bz2
FindGTest: Add target for gmock library
`googlemock` has been absorbed into the [googletest](https://github.com/google/googletest) project and is built and installed from the same source tree. As GTest may be built with or without GMock, skip GMock if it is not present. Do not provide result variables for GMock. They are not provided by upstream GTest's CMake Package Configuration File. Also update the test case to cover linking to `GTest::gmock`.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/FindGTest/Test/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/FindGTest/Test/CMakeLists.txt b/Tests/FindGTest/Test/CMakeLists.txt
index 6537238..9c1eb5e 100644
--- a/Tests/FindGTest/Test/CMakeLists.txt
+++ b/Tests/FindGTest/Test/CMakeLists.txt
@@ -16,3 +16,7 @@ add_executable(test_gtest_var main.cxx)
target_include_directories(test_gtest_var PRIVATE ${GTEST_INCLUDE_DIRS})
target_link_libraries(test_gtest_var PRIVATE ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
add_test(NAME test_gtest_var COMMAND test_gtest_var)
+
+add_executable(test_gmock_tgt main.cxx)
+target_link_libraries(test_gmock_tgt GTest::gmock_main)
+add_test(NAME test_gmock_tgt COMMAND test_gmock_tgt)