]> granicus.if.org Git - graphviz/commitdiff
fix failure to find Cairo, PangoCairo under CMake < 3.12
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 13 Sep 2020 22:05:28 +0000 (15:05 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 13 Sep 2020 22:18:35 +0000 (15:18 -0700)
The changes introduced in 3ecf2f6206a486fecdea870b7f29ea539345642a and
b4f998c133566ef9cb416c085d1ce49e539bec30 were accidentally assuming the behavior
of PkgConfig that is only true after CMake 3.12. Namely that it sets the
*_LINK_LIBRARIES variable for packages it discovers. Closes #1824.

cmake/FindCairo.cmake
cmake/FindPangoCairo.cmake

index bd51494720c93b6f905a0ac508c41719ee46c1f2..0cc48eff228c176dfe463008c911fcaf5d0b64e1 100644 (file)
@@ -37,6 +37,12 @@ else()
     find_package(PkgConfig)
     pkg_check_modules(Cairo cairo)
 
+    # prior to CMake 3.12, PkgConfig does not set *_LINK_LIBRARIES, so do it
+    # manually
+    if (${CMAKE_VERSION} VERSION_LESS 3.12)
+        find_library(Cairo_LINK_LIBRARIES cairo PATHS ENV LIBRARY_PATH)
+    endif()
+
     find_package_handle_standard_args(Cairo DEFAULT_MSG
         Cairo_INCLUDE_DIRS
         Cairo_LIBRARIES
index d1e3fee9f6d13496ef8d25ce01b9ebc9ef5ec184..7e9d3b362f8cc01192ef28eb53f4779c4285fe79 100644 (file)
@@ -70,6 +70,13 @@ else()
     find_package(PkgConfig)
     pkg_check_modules(PangoCairo pangocairo)
 
+    # prior to CMake 3.12, PkgConfig does not set *_LINK_LIBRARIES, so do it
+    # manually
+    if (${CMAKE_VERSION} VERSION_LESS 3.12)
+        find_library(PangoCairo_LINK_LIBRARIES pangocairo-1.0
+          PATHS ENV LIBRARY_PATH)
+    endif()
+
     find_package_handle_standard_args(PangoCairo DEFAULT_MSG
         PangoCairo_INCLUDE_DIRS
         PangoCairo_LIBRARIES