Skip to content

fix Pango plugin build on macOS

Compiling plugin/pango depends on the discovery of PangoCairo and its dependent libraries which is handled by cmake/FindPangoCairo.cmake. This file was assuming all libraries were available at default system paths, which is not true on e.g. macOS when you install libraries via Homebrew or Macports. We now simply ask pkg-config to find all necessary information for us (unless we are on Windows).

This also incidentally cleans up the following warning issued by CMake in CI:

  CMake Warning (dev) at C:/…/FindPackageHandleStandardArgs.cmake:272 (message):
    The package name passed to `find_package_handle_standard_args` (PANGOCAIRO)
    does not match the name of the calling package (PangoCairo).  This can lead
    to problems in calling code that expects `find_package` result variables
    (e.g., `_FOUND`) to follow a certain pattern.
  Call Stack (most recent call first):
    cmake/FindPangoCairo.cmake:20 (find_package_handle_standard_args)
    CMakeLists.txt:85 (find_package)
  This warning is for project developers.  Use -Wno-dev to suppress it.

This commit stems from discussion on the forum. This doesn't seem to fully resolve the macOS problems, but it at least makes things less broken. I'll merge on 2020-08-27 if there are no objections.

Edited by Matthew Fernandez

Merge request reports