1
# Checks whether the gtest library is available on the system
2
# Allows for adjusting the include and library path.
3
# Sets have_gtest=yes if the library is present and
4
# reports the compiler and linker flags in
5
# GTEST_CXXFLAGS AND GTEST_LDFLAGS, respectively.
6
AC_DEFUN([AC_CHECK_GTEST],
8
AC_ARG_WITH([gtest-include-path],
9
[AS_HELP_STRING([--with-gtest-include-path],
10
[location of the Google test headers, defaults to /usr/include])],
11
[GTEST_CXXFLAGS="-I$withval"],
12
[GTEST_CXXFLAGS='-I/usr/include'])
14
AC_ARG_WITH([gtest-lib-path],
15
[AS_HELP_STRING([--with-gtest-lib-path], [location of the Google test libraries])],
16
[GTEST_LDFLAGS="-L$withval -lpthread"],
17
[GTEST_LDFLAGS='-lgtest -lpthread'])
19
AC_HAVE_LIBRARY( [gtest],
21
AC_MSG_WARN([package 'gtest' not found: tests disabled]))