aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2019-02-03 02:57:38 -0500
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2019-02-04 05:24:04 -0500
commit561a6639c45a4e35a638c2e87869c5991fc7d69e (patch)
tree16046d9063c32e8bdf40b216e35e3c4a41829fdd /configure.ac
parent322493235696097b94294f5f466a32f015a95626 (diff)
downloadPROJ-561a6639c45a4e35a638c2e87869c5991fc7d69e.tar.gz
PROJ-561a6639c45a4e35a638c2e87869c5991fc7d69e.zip
Allow building against external GTest with autotools.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 27 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 180f34d9..f0caf4d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -319,18 +319,40 @@ if test x"$SQLITE3_CHECK" != x"yes" ; then
fi
dnl ---------------------------------------------------------------------------
+dnl Check for external Google Test
+dnl ---------------------------------------------------------------------------
+
+AC_ARG_WITH(external-gtest,
+ AS_HELP_STRING([--with-external-gtest],
+ [Whether to use external Google Test]),,)
+
+if test "x$with_external_gtest" == "xyes" ; then
+ AC_MSG_RESULT([using external GTest.])
+ PKG_CHECK_MODULES([GTEST], [gtest >= 1.8.0])
+else
+ AC_MSG_RESULT([using internal GTest.])
+ GTEST_CFLAGS="-I\$(top_srcdir)/test/googletest/include"
+ GTEST_LIBS="\$(top_builddir)/test/googletest/libgtest.la"
+fi
+AM_CONDITIONAL(USE_EXTERNAL_GTEST, [test "x$with_external_gtest" == "xyes"])
+AC_SUBST(GTEST_CFLAGS,$GTEST_CFLAGS)
+AC_SUBST(GTEST_LIBS,$GTEST_LIBS)
+
+dnl ---------------------------------------------------------------------------
dnl Generate files
dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES([Makefile cmake/Makefile src/Makefile include/Makefile include/proj/Makefile include/proj/internal/Makefile
test/Makefile test/cli/Makefile test/gie/Makefile test/gigs/Makefile test/unit/Makefile
- test/googletest/Makefile test/googletest/include/Makefile
- test/googletest/include/gtest/Makefile
- test/googletest/include/gtest/internal/Makefile
- test/googletest/include/gtest/internal/custom/Makefile
- test/googletest/src/Makefile
man/Makefile man/man1/Makefile man/man3/Makefile data/Makefile
jniwrap/Makefile jniwrap/org.osgeo.proj/Makefile jniwrap/org.osgeo.proj/org/Makefile jniwrap/org.osgeo.proj/org/proj4/Makefile])
+if ! test "x$with_external_gtest" = "xyes" ; then
+ AC_CONFIG_FILES([test/googletest/Makefile test/googletest/include/Makefile
+ test/googletest/include/gtest/Makefile
+ test/googletest/include/gtest/internal/Makefile
+ test/googletest/include/gtest/internal/custom/Makefile
+ test/googletest/src/Makefile])
+fi
AC_CONFIG_FILES([data/install], [chmod +x data/install])
AC_CONFIG_FILES([proj.pc])