To deal with this, this PR adds the Graphviz_DEFINITIONS output variable to the FindGraphviz module, and populates with GVDLL when on Windows (on graphviz < 3 defining this definition will be harmless). As that prepocessor definition should not be set when linking static graphviz, and given that we can't detect in FindGraphviz if the linked graphviz is static or not, an ad-hoc CMake variable YCM_FINDGRAPHVIZ_USE_STATIC_GRAPHVIZ is introduced in the case this definition needs to be disabled.
Since graphviz 3, any downstream library that on Windows links against a graphviz shared library needs to define the
GVDLL
preprocessor definition (see https://gitlab.com/graphviz/graphviz/-/blob/3.0.0/CHANGELOG.md#changed).To deal with this, this PR adds the
Graphviz_DEFINITIONS
output variable to theFindGraphviz
module, and populates withGVDLL
when on Windows (on graphviz < 3 defining this definition will be harmless). As that prepocessor definition should not be set when linking static graphviz, and given that we can't detect inFindGraphviz
if the linked graphviz is static or not, an ad-hoc CMake variableYCM_FINDGRAPHVIZ_USE_STATIC_GRAPHVIZ
is introduced in the case this definition needs to be disabled.Partial fix for https://github.com/robotology/robotology-superbuild/pull/1166 and https://github.com/robotology/robotology-superbuild/issues/1152 .