diff --git a/Makefile.am b/Makefile.am index b07ef0f1df..50aa6b9a24 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,12 +2,16 @@ SUBDIRS = doc src tests USE_LCOV=@USE_LCOV@ LCOV=@LCOV@ GENHTML=@GENHTML@ +DISTCHECK_GTEST_CONFIGURE_FLAG=@DISTCHECK_GTEST_CONFIGURE_FLAG@ DISTCLEANFILES = config.report # When running distcheck target, do not install the configurations DISTCHECK_CONFIGURE_FLAGS = --disable-install-configurations +# Use same --with-gtest flag if set +DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_GTEST_CONFIGURE_FLAG) + clean-cpp-coverage: @if [ $(USE_LCOV) = yes ] ; then \ $(LCOV) --directory . --zerocounters; \ diff --git a/configure.ac b/configure.ac index 2c6cfb1afb..b0f5f45fd4 100644 --- a/configure.ac +++ b/configure.ac @@ -650,6 +650,7 @@ fi # if test "$gtest_path" != "no" then + DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest=\"$gtest_path\"" if test "$gtest_path" != "yes"; then GTEST_PATHS=$gtest_path if test -x "${gtest_path}/bin/gtest-config" ; then @@ -690,8 +691,10 @@ else GTEST_INCLUDES= GTEST_LDFLAGS= GTEST_LDADD= + DISTCHECK_GTEST_CONFIGURE_FLAG= fi AM_CONDITIONAL(HAVE_GTEST, test $gtest_path != "no") +AC_SUBST(DISTCHECK_GTEST_CONFIGURE_FLAG) AC_SUBST(GTEST_INCLUDES) AC_SUBST(GTEST_LDFLAGS) AC_SUBST(GTEST_LDADD)