From: Piotrek Zadroga Date: Tue, 26 Sep 2023 10:13:20 +0000 (+0200) Subject: [#3065] get gtest ver with pkg-config X-Git-Tag: Kea-2.5.3~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dddadcb93aeb50ea2f26bfb7500aa2a9f82500ed;p=thirdparty%2Fkea.git [#3065] get gtest ver with pkg-config --- diff --git a/m4macros/ax_gtest.m4 b/m4macros/ax_gtest.m4 index 725f6dab31..93953fa7b5 100644 --- a/m4macros/ax_gtest.m4 +++ b/m4macros/ax_gtest.m4 @@ -169,6 +169,12 @@ if test "x$enable_gtest" = "xyes" ; then GTEST_LDFLAGS="-L$dir/lib" GTEST_LDADD="-lgtest" GTEST_FOUND="true" + if test -f "$dir/lib/pkgconfig/gtest.pc" ; then + pkg-config --modversion "$dir/lib/pkgconfig/gtest.pc" &> /dev/null + if test $? -eq 0; then + GTEST_VERSION="$(pkg-config --modversion "$dir/lib/pkgconfig/gtest.pc")" + fi + fi break else AC_MSG_WARN([Found Google Test include but not the library in $dir.])