From f2337406a34e2a0fe0a6786d648b9934ae7afd89 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Thu, 19 Apr 2018 21:57:10 +0800 Subject: [PATCH] Modify CMakeLists to test for presence of guile-json --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bdb69f7485..21e7d2c0de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,6 +342,19 @@ if (GNC_SRFI64_RESULT EQUAL 0) set (HAVE_SRFI64 TRUE) endif () +# Test that guile has guile-json. +execute_process (COMMAND ${GUILE_EXECUTABLE} -c "(use-modules (json builder) (json parser) (json syntax))" + RESULT_VARIABLE GNC_GUILE_JSON + ERROR_QUIET +) + +if (GNC_GUILE_JSON EQUAL 0) + message (STATUS "guile-json is present.") + set (HAVE_GUILE_JSON TRUE) +else () + message (FATAL_ERROR "guile-json cannot be imported. Abort.") +endif () + # ############################################################ IF (WITH_AQBANKING) GNC_PKG_CHECK_MODULES (GWENHYWFAR REQUIRED gwenhywfar)