]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3065] code cleaning
authorPiotrek Zadroga <piotrek@isc.org>
Wed, 27 Sep 2023 11:27:27 +0000 (13:27 +0200)
committerPiotrek Zadroga <piotrek@isc.org>
Wed, 4 Oct 2023 17:36:20 +0000 (17:36 +0000)
m4macros/ax_gtest.m4

index e163ec92a6a18c956ee6c15b6cf34fbfad544a7e..14382b179574f7f184027534e26b2971c877c751 100644 (file)
@@ -110,27 +110,23 @@ if test "x$enable_gtest" = "xyes" ; then
         GTEST_VERSION="${GTEST_VERSION#gtest-}"
         GTEST_VERSION="${GTEST_VERSION#googletest-}"
 
-        # If the GTEST_VERSION is still not correct semver, we need to determine googletest version in other way.
-        # Let's try to extract it from CMake build script used by Google Test starting from version 1.8.0.
         posix_regex=$(expr "5" : "\([[:digit:]]\)")
-        if test "$posix_regex" = "5" ; then
+        if test "${posix_regex}" = "5" ; then
             semver_regex='[^[:digit:]]\{0,\}\([[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\).\{0,\}'
-            AC_MSG_NOTICE([posix regex used])
         else
             semver_regex='[[^0-9]]\{0,\}\([[0-9]]\{1,\}\.[[0-9]]\{1,\}\.[[0-9]]\{1,\}\).\{0,\}'
-            AC_MSG_NOTICE([non posix regex used])
         fi
+
         gtest_version_candidate=
         gtest_version_candidate=$(expr "$GTEST_VERSION" : "$semver_regex")
         gtest_version_found="no"
 
         if test -z "$gtest_version_candidate" ; then
+            # If the GTEST_VERSION is still not correct semver, we need to determine googletest version in other way.
+            # Let's try to extract it from CMake build script used by Google Test starting from version 1.8.0.
             if test -f "$cmakelists" ; then
-                AC_MSG_NOTICE([CMakeLists.txt found $cmakelists])
                 gtest_version_line=$($AWK '/set\(GOOGLETEST_VERSION/ { print }' "$cmakelists")
-                AC_MSG_NOTICE([gtest_version_line $gtest_version_line])
                 gtest_version_candidate=$(expr "$gtest_version_line" : "$semver_regex")
-                AC_MSG_NOTICE([gtest_version_candidate $gtest_version_candidate])
                 if test -n "$gtest_version_candidate"; then
                     gtest_version_found="yes"
                     GTEST_VERSION=$gtest_version_candidate
@@ -154,6 +150,7 @@ if test "x$enable_gtest" = "xyes" ; then
         fi
 
         if test $gtest_version_found = "no" ; then
+            AC_MSG_WARN([Could not find GTEST version])
             GTEST_VERSION="unknown"
         fi
     fi