diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e288817bc1f53169f3a9193cd3aa31cb0227ebd..402a178dcfd4f92d2697c5b80912b25922ea545f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The modgraph.php example no longer includes gv.php, which is no longer generated by SWIG 4.1.0. #2322 +- Ensure HAVE_PANGOCAIRO is set when using CMake and the library is available + ## [7.0.5] – 2022-12-23 ### Fixed diff --git a/cmake/FindGD.cmake b/cmake/FindGD.cmake index d7e0cc968814d790e93b3a0707bbc29a192b3601..54c87dde0f5f1514158f26c1c825866b205830f2 100644 --- a/cmake/FindGD.cmake +++ b/cmake/FindGD.cmake @@ -18,6 +18,11 @@ set(GD_INCLUDE_DIRS ${GD_INCLUDE_DIR}) set(GD_LIBRARIES ${GD_LIBRARY}) set(GD_RUNTIME_LIBRARIES ${GD_RUNTIME_LIBRARY}) +find_package(PkgConfig) +if(PkgConfig_FOUND) + pkg_check_modules(GDLIB gdlib>=2.0.33) +endif() + if(GD_LIBRARY) find_program(GDLIB_CONFIG gdlib-config) if(GDLIB_CONFIG) @@ -50,7 +55,7 @@ if(GD_LIBRARY) set(HAVE_GD_GIF 1) endif() else() - if(APPLE) + if(APPLE OR GDLIB_FOUND) # At time of writing, Macports does not package libgd. So assume the user # obtained this through Homebrew and hard code the options the Homebrew # package enables. @@ -60,7 +65,7 @@ if(GD_LIBRARY) set(HAVE_GD_FREETYPE 1) set(HAVE_GD_GIF 1) else() - message(WARNING "gdlib-config not found; skipping feature checks") + message(WARNING "gdlib-config/gdlib pkgconfig not found; skipping feature checks") endif() endif() endif() diff --git a/cmake/config_checks.cmake b/cmake/config_checks.cmake index 8046df3e3bd6d5e8f09b20941596fe3665841d84..a8334086bd49659b55b5abbd4e07c4fe2f6e99db 100644 --- a/cmake/config_checks.cmake +++ b/cmake/config_checks.cmake @@ -35,6 +35,7 @@ set( HAVE_LIBGD ${GD_FOUND} ) if(with_zlib AND ZLIB_FOUND) set(HAVE_ZLIB 1) endif() +set( HAVE_PANGOCAIRO ${PANGOCAIRO_FOUND}) if(LTDL_FOUND) set(ENABLE_LTDL 1) diff --git a/config-cmake.h.in b/config-cmake.h.in index c850d221b9f138c94474a11748c40b7d84034387..3b7b49ace26d241c14bc9e332d5d5c612e7682ff 100644 --- a/config-cmake.h.in +++ b/config-cmake.h.in @@ -39,6 +39,7 @@ typedef SSIZE_T ssize_t; #cmakedefine HAVE_GD_FREETYPE #cmakedefine HAVE_GD_GIF #cmakedefine HAVE_ZLIB +#cmakedefine HAVE_PANGOCAIRO // Values #define BROWSER "@BROWSER@" diff --git a/plugin/gd/CMakeLists.txt b/plugin/gd/CMakeLists.txt index fbf9b6d017a249798f44ddcbcb191124a20d6a54..90e463d36cb1381015615bc5d159def7b9155ef2 100644 --- a/plugin/gd/CMakeLists.txt +++ b/plugin/gd/CMakeLists.txt @@ -34,6 +34,16 @@ if(GD_FOUND) ${GD_LIBRARIES} ) + if (PANGOCAIRO_FOUND) + target_include_directories(gvplugin_gd SYSTEM PRIVATE + ${PANGOCAIRO_INCLUDE_DIRS} + ) + + target_link_libraries(gvplugin_gd + ${PANGOCAIRO_LINK_LIBRARIES} + ) + endif() + # Installation location of library files install( TARGETS gvplugin_gd diff --git a/plugin/webp/CMakeLists.txt b/plugin/webp/CMakeLists.txt index ee4e520051300eca25cac828aa7e44f9669f6ed0..a8a6009b0d2e5568f8e14ef4dae171c94052e7da 100644 --- a/plugin/webp/CMakeLists.txt +++ b/plugin/webp/CMakeLists.txt @@ -28,6 +28,16 @@ if(WEBP_FOUND) ${WEBP_LINK_LIBRARIES} ) + if (PANGOCAIRO_FOUND) + target_include_directories(gvplugin_webp SYSTEM PRIVATE + ${PANGOCAIRO_INCLUDE_DIRS} + ) + + target_link_libraries(gvplugin_webp + ${PANGOCAIRO_LINK_LIBRARIES} + ) + endif() + install( TARGETS gvplugin_webp RUNTIME DESTINATION ${BINARY_INSTALL_DIR}