Open cg-pasdzierny opened 1 year ago
which branch are you using? please try master
thanks for the reply. I was using master via git.
strange.
I don't see any files in the master branch that contain the line '#include
hello,
as the title of this thread indicates it was
/usr/include/graphviz/types.h
which is a graphviz file.
I guess sth went wrong with the include paths passed to the compiler when it happened:
In file included from .../kdab-state-machine-editor/KDStateMachineEditor/src/core/layout/graphvizlayout/gvutils.h:19,
from .../kdab-state-machine-editor/KDStateMachineEditor/src/core/layout/graphvizlayout/gvutils.cpp:17:
/usr/include/graphviz/types.h:49:10: fatal error: cgraph.h: No such file or directory
49 | #include <cgraph.h>
| ^~~~~~~~~~
compilation terminated.
make[2]: *** [src/core/CMakeFiles/kdstatemachineeditor_core.dir/build.make:398: src/core/CMakeFiles/kdstatemachineeditor_core.dir/layout/graphvizlayout/gvutils.cpp.o] Error 1
I attach both the cmake log and the complete make log file. kdab-make-230823-030341.log kdab-cmake-230823-030326.log
As written I managed to sucessfully build by changing the referred graphviz file, but of course that is wrong as it would break other graphviz based builds expecting graphviz devel files as they are ;)
you're right. sorry.
maybe we need to increase the minimum required graphviz version beyond 2.30.1 ?
another possibility is to pass -DWITH_INTERNAL_GRAPHVIZ=True
to CMake, which will download and build version 2.48 for you. no idea if that still works
and yet another possibility is to add vcpkg support
@winterz @cg-pasdzierny
It looks to me like the FindGraphviz.cmake
discovery code is just wrong.
As written, it will discover the include path for a /usr/include/graphviz/cgraph.h
as /usr/include/
:
...But the Graphviz pkg-config data has the include path as /usr/include/graphviz
. IOW, it expects that the graphviz
subdirectory will be on the include path, as @cg-pasdzierny discovered:
$ pkg-config --cflags libcgraph
-I/usr/include/graphviz
(This is with Graphviz 8.1.0 installed on Fedora 39, but I doubt it's changed anytime recently.)
Looks to me like it should be,
find_path(
GRAPHVIZ_INCLUDE_DIR
NAMES cgraph.h graph.h
HINTS ${_GRAPHVIZ_INCLUDE_DIR}
PATH_SUFFIXES graphviz
${_GRAPHVIZ_FIND_OPTS}
)
(EDIT: Changed to look for cgraph.h
first, as the less generic name.)
hello, I am pretty sure my fix is wrong but without changing
to line 49 #include <graphviz/cgraph.h>
my build stopped with "cgraph.h not found".
I am using red hat rhel 7 with gcc 11.2.1 and graphviz-devel 2.30.1
Thanks, Martin.