]> granicus.if.org Git - graphviz/commitdiff
CMake: enable Poppler plugin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 6 Apr 2022 02:29:34 +0000 (19:29 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 9 Apr 2022 18:20:29 +0000 (11:20 -0700)
Gitlab: #1836

plugin/CMakeLists.txt
plugin/poppler/CMakeLists.txt [new file with mode: 0644]

index c4608aa7eeb7ce3d1e7fd56a82b5a3925f6f2fd8..81f952b3dfd0166973ee42658b90891e604c6da1 100644 (file)
@@ -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 (file)
index 0000000..8a63537
--- /dev/null
@@ -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()