summaryrefslogtreecommitdiffstats
path: root/m4macros/ax_gtest.m4
diff options
context:
space:
mode:
authorPiotrek Zadroga <piotrek@isc.org>2023-10-03 17:57:35 +0200
committerPiotrek Zadroga <piotrek@isc.org>2023-10-04 19:36:20 +0200
commit2e557e88e02463f1236922f6de67144b31b18435 (patch)
tree0041e8e112a2c790153b77e02b87f3a6e8d2b270 /m4macros/ax_gtest.m4
parent[#3065] addressing review comments (diff)
downloadkea-2e557e88e02463f1236922f6de67144b31b18435.tar.xz
kea-2e557e88e02463f1236922f6de67144b31b18435.zip
[#3065] looking for CMakeLists.txt enhanced
Diffstat (limited to 'm4macros/ax_gtest.m4')
-rw-r--r--m4macros/ax_gtest.m47
1 files changed, 5 insertions, 2 deletions
diff --git a/m4macros/ax_gtest.m4 b/m4macros/ax_gtest.m4
index 876c559b7e..984db8ad18 100644
--- a/m4macros/ax_gtest.m4
+++ b/m4macros/ax_gtest.m4
@@ -73,6 +73,7 @@ if test "x$enable_gtest" = "xyes" ; then
# If not specified, try some common paths.
GTEST_SOURCE=
for d in /usr/src/googletest /usr/src/gtest /usr/local /usr/pkg /opt /opt/local ; do
+ cmakelists="$d/CMakeLists.txt"
if test ! -d "$d"/src -a -d "$d"/googletest; then
d=$d/googletest
fi
@@ -86,6 +87,7 @@ if test "x$enable_gtest" = "xyes" ; then
AC_MSG_ERROR([no gtest sources found])
fi
else
+ cmakelists="$GTEST_SOURCE/CMakeLists.txt"
if test ! -d $GTEST_SOURCE/src -a -d $GTEST_SOURCE/googletest; then
GTEST_SOURCE=$GTEST_SOURCE/googletest
fi
@@ -104,10 +106,11 @@ if test "x$enable_gtest" = "xyes" ; then
# Versions starting from 1.8.0 are put in the googletest directory. If the basename
# returns googletest string, we need to cut it off and try basename again.
- cmakelists=
if test "$GTEST_VERSION" = "googletest"; then
GTEST_VERSION=${GTEST_SOURCE%"/googletest"}
- cmakelists="$GTEST_VERSION/CMakeLists.txt"
+ if test -f "$GTEST_VERSION/CMakeLists.txt" ; then
+ cmakelists="$GTEST_VERSION/CMakeLists.txt"
+ fi
GTEST_VERSION=$(basename "$GTEST_VERSION")
fi
GTEST_VERSION="${GTEST_VERSION#googletest-release-}"