I believe, this bug deserves Stable Release Update. It is fixed in
Ubuntu-20.10 eoan and Debian testing (bullseye) googletest-1.10.0-3
package

Changes are small 
http://launchpadlibrarian.net/477912854/googletest_1.10.0-2_1.10.0-3.diff.gz
and if there is any reason to worry, the fix for debbug 958659 could be dropped 
for focal.
I hope this is enough to add "patch" tag.

In respect to CMake, the bug have workaround through using lower level interface
(other ways to include gtest independent of pkg-config are available as well)

    find_package(PkgConfig REQUIRED)
    pkg_search_module(GTEST REQUIRED gtest_main)
    add_executable(test test.cc)
    target_compile_options(test PRIVATE ${GTEST_CFLAGS})
    target_link_libraries(test ${GTEST_LDFLAGS})

However such approach is against CMake best practices in respect to imported 
libraries
https://rix0r.nl/blog/2015/08/13/cmake-guide/
Due to unfortunate mistake in pkg-config files higher level interface is 
unavailable,
it is necessary to use CFLAGS and LDFLAGS directly,
the following does not work

    find_package(PkgConfig REQUIRED)
    pkg_check_modules(gtest_main REQUIRED IMPORTED_TARGET gtest_main)
    add_executable(test test.cc)
    target_compile_options(test PkgConfig::gtest_main)

I hope, steps to reproduce in debian bug are clear
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958099

googletest in ubuntu is something unlucky. Prebuilt libraries returned to 
libgtest-dev
soon after bionic release (see debbug 896559). Now focal has been release with 
broken
pkg-config file.

Please, consider googletest-1.10.0-3 release for focal,
required changes are small and safe and allows to avoid
impression of slightly broken package requiring special treatment.

** Tags added: patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1876042

Title:
  Incorrect prefix in .pc files

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/googletest/+bug/1876042/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to