* Steven Robbins <st...@sumost.ca> [2021-09-15 18:17]:
In case you're wondering, apparently this bug has been exposed by
the changes in the new CMake version that has hit unstable, so this
will possibly affect more packages.
Intriguing.  Note that gtest is intended as the base layer (gmock is built on
top of gtest), so it would be a loss to have libgtest-dev pull in gmock.
Hopefully there's an alternative fix.
AFAICT the root cause is that upstream exports both GTest and GMock
targets to the same export set (GTestTargets), which causes problems
if only one of those is installed.

One alternative solution would be to patch the upstream CMake files
and export GMock independently with their own GMockConfig.cmake and
GMockTargets.cmake.  Then, for backwards compatibility, you could
add something like

    find_package(GMock QUIET)
    if(NOT GMock_FOUND)
        message(STATUS "GMock not found, targets will not be imported")
    endif()

to the end of GTestConfig.cmake.

Cheers
Timo

--
⢀⣴⠾⠻⢶⣦⠀   ╭────────────────────────────────────────────────────╮
⣾⠁⢠⠒⠀⣿⡁   │ Timo Röhling                                       │
⢿⡄⠘⠷⠚⠋⠀   │ 9B03 EBB9 8300 DF97 C2B1  23BF CC8C 6BDD 1403 F4CA │
⠈⠳⣄⠀⠀⠀⠀   ╰────────────────────────────────────────────────────╯

Attachment: signature.asc
Description: PGP signature

Reply via email to