From 18e8303d1811f9848318b4ef8831e6624fbffb2b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Mon, 27 Nov 2023 17:39:02 +0100 Subject: [PATCH] yarpviz: Support compilation with graphviz >= 9 --- doc/release/yarp_3_9/yarpviz_graphviz9.md | 3 +++ extern/qgv/CMakeLists.txt | 6 ++++++ extern/qgv/qgv/QGVCore/private/QGVCore.h | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 doc/release/yarp_3_9/yarpviz_graphviz9.md diff --git a/doc/release/yarp_3_9/yarpviz_graphviz9.md b/doc/release/yarp_3_9/yarpviz_graphviz9.md new file mode 100644 index 00000000000..a518b09be09 --- /dev/null +++ b/doc/release/yarp_3_9/yarpviz_graphviz9.md @@ -0,0 +1,3 @@ +#### `yarpviz` + +* Support compilation with Graphviz >= 9. diff --git a/extern/qgv/CMakeLists.txt b/extern/qgv/CMakeLists.txt index fee2df4dd4d..571b2753f7d 100644 --- a/extern/qgv/CMakeLists.txt +++ b/extern/qgv/CMakeLists.txt @@ -53,6 +53,12 @@ if(Graphviz_DEFINITIONS) target_compile_definitions(YARP_priv_qgvcore PRIVATE ${Graphviz_DEFINITIONS}) endif() +if(Graphviz_VERSION) + if(Graphviz_VERSION VERSION_GREATER_EQUAL 9.0) + target_compile_definitions(YARP_priv_qgvcore PRIVATE GRAPHVIZ_VERSION_GE_9) + endif() +endif() + set_property(TARGET YARP_priv_qgvcore PROPERTY FOLDER "Libraries/External") diff --git a/extern/qgv/qgv/QGVCore/private/QGVCore.h b/extern/qgv/qgv/QGVCore/private/QGVCore.h index c5d47f46c04..8e5c7243c10 100644 --- a/extern/qgv/qgv/QGVCore/private/QGVCore.h +++ b/extern/qgv/qgv/QGVCore/private/QGVCore.h @@ -93,7 +93,9 @@ class QGVCore rdr.len = strlen(cp); rdr.cur = 0; +#ifndef GRAPHVIZ_VERSION_GE_9 disc.mem = &AgMemDisc; +#endif disc.id = &AgIdDisc; disc.io = &memIoDisc; g = agread (&rdr, &disc);