From 20884c9e8a71def93f8536a5990f735350a3321c Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Sat, 31 Dec 2022 12:29:04 +0000 Subject: [PATCH 1/4] CMake: Set HAVE_PANGOCAIRO to 1 if found --- CHANGELOG.md | 2 ++ cmake/config_checks.cmake | 1 + config-cmake.h.in | 1 + 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e288817bc..402a178dcf 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/config_checks.cmake b/cmake/config_checks.cmake index 8046df3e3b..a8334086bd 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 c850d221b9..3b7b49ace2 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@" -- GitLab From 39de0d909ea0e0fb98940c74a621741d1dc9cb69 Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Mon, 2 Jan 2023 12:11:02 +0000 Subject: [PATCH 2/4] CMake: Specify PANGOCAIRO as (optional) dependency for gvplugin_gd --- plugin/gd/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin/gd/CMakeLists.txt b/plugin/gd/CMakeLists.txt index fbf9b6d017..90e463d36c 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 -- GitLab From cfe25e0f8acc970ff8bfc7c5286d88ce601cfaa4 Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Mon, 2 Jan 2023 12:27:11 +0000 Subject: [PATCH 3/4] CMake: Specify PANGOCAIRO as (optional) dependency for gvplugin_webp --- plugin/webp/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin/webp/CMakeLists.txt b/plugin/webp/CMakeLists.txt index ee4e520051..a8a6009b0d 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} -- GitLab From 6c1049de1a746f2966cad8207fe9b886687c0c20 Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Mon, 2 Jan 2023 14:04:33 +0000 Subject: [PATCH 4/4] CMake: Add support for libgd >= 2.0.33 --- cmake/FindGD.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/FindGD.cmake b/cmake/FindGD.cmake index d7e0cc9688..54c87dde0f 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() -- GitLab