cmake: Simplify and improve FindGraphviz.cmake
ClosedPublic

Authored by rakuco on Jul 15 2018, 9:44 PM.

Details

Summary

Remove a lot of cruft, and move detection of dot(1) to a separate
FindDOT.cmake. More specifically:

  • Read Graphviz's version from a header file instead of invoking dot during configuration. dot should only be needed at runtime. Doing so allows us to significantly trim down FindGraphviz.cmake.
  • State that Graphviz 2.30 is the minimum version we support in CMakeLists.txt, so that FindGraphviz.cmake remains more generic.
  • Always try to invoke pkg-config in FindGraphviz.cmake, there is no need to avoid it on Windows, we just don't use its output if it is not present.
  • Remove a bunch of hardcoded locations from find_library(), let CMake handle those automatically and just provide pkg-config's output as HINTS.
  • Create a FindDOT.cmake that looks for dot, and lists it as a runtime dependency in CMake's summary.
Test Plan

Everything still worked fine.

Diff Detail

Repository
R491 KGraphViewer
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rakuco requested review of this revision.Jul 15 2018, 9:44 PM
rakuco created this revision.
This revision was not accepted when it landed; it landed in state Needs Review.Sun, May 31, 11:49 AM
This revision was automatically updated to reflect the committed changes.