Backport gmock and gmock_main target definitions
Googletest has provided the imported targets
GTest::gmock
and GTest::gmock_main
since version 1.8.1.
The CMake FindGTest module only forwards calls to the config package
starting from CMake v3.20.0. Backport compatible imported target
definitions.
Issue was investigated in https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6632#note_1085849
Also backported to Yocto https://www.mail-archive.com/openembedded-core@lists.openembedded.org/msg156130.html
Tested on my recent Ubuntu 20.04 installation. The version I got with debchange
was 3.18.4-2+deb11u1~bpo10+1ubuntu1
, but I changed it to 3.18.4-3
before pushing.