If there is no system wide package, try using a regular header as before. Signed-off-by: Alexander Stein <alexander.stein@xxxxxxxxxxx> --- bindings/cxx/tests/Makefile.am | 2 +- configure.ac | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bindings/cxx/tests/Makefile.am b/bindings/cxx/tests/Makefile.am index 155445f..d1da0d3 100644 --- a/bindings/cxx/tests/Makefile.am +++ b/bindings/cxx/tests/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/bindings/cxx/ -I$(top_srcdir)/include AM_CPPFLAGS += -I$(top_srcdir)/tests/mockup/ -AM_CPPFLAGS += -Wall -Wextra -g -std=gnu++11 +AM_CPPFLAGS += -Wall -Wextra -g -std=gnu++11 $(CATCH2_CFLAGS) AM_LDFLAGS = -lgpiodcxx -L$(top_builddir)/bindings/cxx/ AM_LDFLAGS += -lgpiomockup -L$(top_builddir)/tests/mockup/ AM_LDFLAGS += -pthread diff --git a/configure.ac b/configure.ac index 0459007..bf364e7 100644 --- a/configure.ac +++ b/configure.ac @@ -164,9 +164,11 @@ then if test "x$with_tests" = xtrue then - AC_LANG_PUSH([C++]) - AC_CHECK_HEADERS([catch2/catch.hpp], [], [HEADER_NOT_FOUND_CXX([catch2/catch.hpp])]) - AC_LANG_POP([C++]) + PKG_CHECK_MODULES([CATCH2], [catch2],, [ + AC_LANG_PUSH([C++]) + AC_CHECK_HEADERS([catch2/catch.hpp], [], [HEADER_NOT_FOUND_CXX([catch2/catch.hpp])]) + AC_LANG_POP([C++]) + ]) fi fi -- 2.22.0