The libgtest-dev and libgmock-dev are both built from the googletest source package. Googletest upstream has provided a CMake **config file package** since version 1.8.1, but for many releases, this config file package has not been included in the -dev packages.
When developers build a CMake project that wants to use a prebuilt GoogleTest for testing, they typically call FindPackage(GTest <REQUIRED_VERSION>) to locate the library. Since the config file package has not been included in libgtest-dev, the FindPackage CMake call falls back to using the FindGTest.cmake module originating from cmake and included in the cmake-data package.
So for several releases up to and including jammy jellyfish, the Imported targets:
* GTest::gtest
* GTest::gtest_main
* GTest::gmock
* GTest::gmock_main
have not been available in the distribution provided packages although defined by Googletest upstream.
This issue should already be fixed in kinetic, since the CMake version is 3.24, which includes the update to cmake's FindGTest.cmake module.
I would also like to get this to jammy as a low priority update. Applying only the patch to FindGTest.cmake should make the risk of the update negligible.
The libgtest-dev and libgmock-dev are both built from the googletest source package. Googletest upstream has provided a CMake **config file package** since version 1.8.1, but for many releases, this config file package has not been included in the -dev packages.
When developers build a CMake project that wants to use a prebuilt GoogleTest for testing, they typically call FindPackage(GTest <REQUIRED_VERSION>) to locate the library. Since the config file package has not been included in libgtest-dev, the FindPackage CMake call falls back to using the FindGTest.cmake module originating from cmake and included in the cmake-data package.
So for several releases up to and including jammy jellyfish, the Imported targets:
* GTest::gtest
* GTest::gtest_main
* GTest::gmock
* GTest::gmock_main
have not been available in the distribution provided packages although defined by Googletest upstream.
Issue in CMake issue tracker https:/ /gitlab. kitware. com/cmake/ cmake/- /issues/ 17365 /gitlab. kitware. com/cmake/ cmake/- /merge_ requests/ 6632 /salsa. debian. org/cmake- team/cmake/ -/merge_ requests/ 11
CMake Merge Request https:/
Issue in Debian CMake packaging https:/
This issue should already be fixed in kinetic, since the CMake version is 3.24, which includes the update to cmake's FindGTest.cmake module.
I would also like to get this to jammy as a low priority update. Applying only the patch to FindGTest.cmake should make the risk of the update negligible.