This works well in another project of mine, which is an apllication but the settings seems to be ignored by the compiler in my current project which is a library.
The compiler casts an undefined reference error at every command which is defined in the /usr/include/graphviz/gvc.h headerfile.
I have tried to include the headerfile with an absolute path , so I assume that the headerfile is found but the library not linked.
My other project uses the same path and it compiles and works correctly.
What is the exact syntax in order to link the graphviz library ?
They don’t seem to provide a CMake config, so you can either use a Find module made by someone else (maybe this one will work, I haven’t tested) or rely on pkg-config instead, as they do provide those, or at least that is the case in my distribution:
# ...
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.5.1")
-- Checking for modules 'libcdt;libcgraph;libgvc'
-- Found libcdt, version 14.1.5
-- Found libcgraph, version 14.1.5
-- Found libgvc, version 14.1.5
-- GRAPHVIZ_INCLUDE_DIRS: /usr/include;/usr/include/graphviz
-- GRAPHVIZ_LIBRARIES: gvc;cgraph;cdt
# ...