From 5727234efb74102a24eeac13b9acb3465760d057 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 5 Apr 2022 19:29:34 -0700 Subject: [PATCH] CMake: enable Poppler plugin Gitlab: #1836 --- plugin/CMakeLists.txt | 1 + plugin/poppler/CMakeLists.txt | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 plugin/poppler/CMakeLists.txt diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index c4608aa7e..81f952b3d 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -8,6 +8,7 @@ add_subdirectory(glitz) add_subdirectory(gs) add_subdirectory(neato_layout) add_subdirectory(pango) +add_subdirectory(poppler) add_subdirectory(rsvg) add_subdirectory(webp) add_subdirectory(xlib) diff --git a/plugin/poppler/CMakeLists.txt b/plugin/poppler/CMakeLists.txt new file mode 100644 index 000000000..8a635375f --- /dev/null +++ b/plugin/poppler/CMakeLists.txt @@ -0,0 +1,52 @@ +find_package(PANGOCAIRO) +find_package(PkgConfig) +if(PkgConfig_FOUND) + pkg_check_modules(POPPLER poppler-glib) +endif() + +if(PANGOCAIRO_FOUND AND POPPLER_FOUND) + + add_library(gvplugin_poppler SHARED + gvloadimage_poppler.c + gvplugin_poppler.c + ) + + target_include_directories(gvplugin_poppler PRIVATE + ../../lib + ../../lib/cdt + ../../lib/cgraph + ../../lib/common + ../../lib/gvc + ../../lib/pathplan + ) + + target_include_directories(gvplugin_poppler SYSTEM PRIVATE + ${PANGOCAIRO_INCLUDE_DIRS} + ${POPPLER_INCLUDE_DIRS} + ) + + target_link_libraries(gvplugin_poppler + ${PANGOCAIRO_LIBRARIES} + ${POPPLER_LIBRARIES} + ) + + install( + TARGETS gvplugin_poppler + RUNTIME DESTINATION ${BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} + ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR} + ) + + set_target_properties(gvplugin_poppler PROPERTIES + VERSION ${GRAPHVIZ_PLUGIN_VERSION}.0.0 + SOVERSION ${GRAPHVIZ_PLUGIN_VERSION} + ) + + if(MINGW) + # work around https://gitlab.kitware.com/cmake/cmake/-/issues/21716 + set_target_properties(gvplugin_poppler PROPERTIES + RUNTIME_OUTPUT_NAME gvplugin_poppler-${GRAPHVIZ_PLUGIN_VERSION} + ) + endif() + +endif() -- 2.40.0