]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3065] get gtest ver with pkg-config
authorPiotrek Zadroga <piotrek@isc.org>
Tue, 26 Sep 2023 10:13:20 +0000 (12:13 +0200)
committerPiotrek Zadroga <piotrek@isc.org>
Wed, 4 Oct 2023 17:36:20 +0000 (17:36 +0000)
m4macros/ax_gtest.m4

index 725f6dab313690cfc19b81adaf829c355084876f..93953fa7b5aea1d361d633f04f42c869937c4921 100644 (file)
@@ -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.])