cmake: Simplify and improve FindGraphviz.cmake

Authored by rakuco on May 30 2020, 7:20 PM.

Description

cmake: Simplify and improve FindGraphviz.cmake

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.

Reviewers: kossebau, jriddell, kleag, adridg

Differential Revision: https://phabricator.kde.org/D14146