Add Google Mock (GMock) import targets to the FindGTest find module
The latest version of the FindGTest CMake find module does not support Google Mock (GMock), which is a subproject of Google Test (GTest) since v1.8.0.
The best solution would be the addition of a CMake package configuration file to GTest itself (by the library authors), as suggested in this issue.
Due to the fact that GTest itself does not provide a CMake package configuration (yet), the CMake find module shipped with CMake should add the imported targets GMock::GMock
and GMock::Main
.
If the GTest authors decide to add that feature, the "official" CMake find module could be marked as deprecated in the future. Since then we do need a reliable way to depend on GMock with Modern CMake, i.e. using an imported target. Currently each client has to implement its own solution, which ultimately results in this (which only shows results for FindGMock.cmake
on GitHub).