If there is no system wide package, try using a regular header as before.
Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
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
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