Re: [dunfell 16/18] cmake: FindGTest: Add target for gmock library

Eero Aaltonen

On Fri, 2021-12-10 at 18:49 +0000, Jasper Orschulko wrote:
Hello everyone,

after some digging we identified the issue to be on our part.
We have been using "GTEST_LIBRARY" and "GTEST_MAIN_LIBRARY" in our
CMake scripts instead of "GTEST_LIBRARIES" and
as described in the cmake docs:

Thank you for providing more details.

The gmock target can be backported to dunfell in an alternative way, by
leaving out the
find_package(GTest QUIET NO_MODULE)

call and subsequent lines and letting the FindModule create all the
definitions. This would leave also the undocumented variables intact,
if that is desired.

This should be as simple as dropping the lines
# first specifically look for the CMake version of GTest
find_package(GTest QUIET NO_MODULE)

# if we found the GTest cmake package then we are done, and
# can print what we found and return.

set(GTEST_LIBRARIES GTest::gtest)
set(GTEST_MAIN_LIBRARIES GTest::gtest_main)



Eero Aaltonen

Join { to automatically receive all group messages.