From 9c2c99696e2c18f9837576824408c679dff0a59e Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 4 Mar 2020 13:59:46 +0100 Subject: [PATCH] graphviz: fix broken detection --- CMakeLists.txt | 4 ++-- include/villas/super_node.hpp | 4 +++- lib/CMakeLists.txt | 10 +++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cd3f735e..969f89a4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,7 +106,7 @@ pkg_check_modules(COMEDILIB IMPORTED_TARGET comedilib>=0.11.0) pkg_check_modules(LIBZMQ IMPORTED_TARGET libzmq>=2.2.0) pkg_check_modules(LIBULDAQ IMPORTED_TARGET libuldaq>=1.0.0) pkg_check_modules(UUID IMPORTED_TARGET REQUIRED uuid>=2.23) -pkg_check_modules(NANOMSG IMPORTED_TARGET libcgraph>=2.30) +pkg_check_modules(CGRAPH IMPORTED_TARGET libcgraph>=2.30) pkg_check_modules(NANOMSG IMPORTED_TARGET nanomsg) if(NOT NANOMSG_FOUND) pkg_check_modules(NANOMSG IMPORTED_TARGET libnanomsg>=1.0.0) @@ -127,7 +127,7 @@ cmake_dependent_option(WITH_TESTS "Run tests" cmake_dependent_option(WITH_PLUGINS "Build plugins" ON "TOPLEVEL_PROJECT" OFF) cmake_dependent_option(WITH_CLIENTS "Build client applications" ON "TOPLEVEL_PROJECT" OFF) cmake_dependent_option(WITH_DOC "Build documentation" ON "TOPLEVEL_PROJECT" OFF) -cmake_dependent_option(WITH_GRAPHVIZ "Build with Graphviz" ON "Graphviz_FOUND" OFF) +cmake_dependent_option(WITH_GRAPHVIZ "Build with Graphviz" ON "CGRAPH_FOUND" OFF) cmake_dependent_option(WITH_NODE_AMQP "Build with amqp node-type" ON "RABBITMQ_C_FOUND" OFF) cmake_dependent_option(WITH_NODE_COMEDI "Build with comedi node-type" ON "COMEDILIB_FOUND" OFF) diff --git a/include/villas/super_node.hpp b/include/villas/super_node.hpp index f54c33faf..c2b9bf899 100644 --- a/include/villas/super_node.hpp +++ b/include/villas/super_node.hpp @@ -26,7 +26,9 @@ #include #ifdef WITH_GRAPHVIZ -#include +extern "C" { + #include +} #endif #include diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index e5c14660c..8785b989c 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -77,6 +77,11 @@ if(WITH_WEB) list(APPEND LIBRARIES PkgConfig::LIBWEBSOCKETS ${LIBWEBSOCKETS_LDFLAGS}) endif() +if(WITH_GRAPHVIZ) + list(APPEND INCLUDE_DIRS ${CGRAPH_INCLUDE_DIRS}) + list(APPEND LIBRARIES PkgConfig::CGRAPH) +endif() + if(WITH_NODE_INFINIBAND) list(APPEND LIB_SRC memory/ib.cpp) endif() @@ -92,11 +97,6 @@ if(WITH_CONFIG) list(APPEND LIBRARIES PkgConfig::LIBCONFIG) endif() -if(WITH_GRAPHVIZ) - list(APPEND INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIRS}) - list(APPEND LIBRARIES ${GRAPHVIZ_LIBRARIES}) -endif() - if(WITH_HOOKS) list(APPEND LIB_SRC hook.cpp