]> granicus.if.org Git - graphviz/commitdiff
CMake: enable GDK plugin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 3 Apr 2022 19:03:41 +0000 (12:03 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 9 Apr 2022 01:03:36 +0000 (18:03 -0700)
Gitlab: #1836

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

index 6f31f36aa5eafcc10c643aef7a1f76db379e02ed..42c13d6c48d7ba1eb89895e0f91a205aa118d197 100644 (file)
@@ -3,6 +3,7 @@ add_subdirectory(devil)
 add_subdirectory(dot_layout)
 add_subdirectory(gd)
 add_subdirectory(gdiplus)
+add_subdirectory(gdk)
 add_subdirectory(glitz)
 add_subdirectory(gs)
 add_subdirectory(neato_layout)
diff --git a/plugin/gdk/CMakeLists.txt b/plugin/gdk/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9b46950
--- /dev/null
@@ -0,0 +1,56 @@
+find_package(PANGOCAIRO)
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+  pkg_check_modules(GDK gdk-2.0)
+  pkg_check_modules(GDK_PIXBUF gdk-pixbuf-2.0)
+endif()
+
+if(GDK_FOUND AND GDK_PIXBUF_FOUND AND PANGOCAIRO_FOUND)
+
+  add_library(gvplugin_gdk SHARED
+    gvdevice_gdk.c
+    gvloadimage_gdk.c
+    gvplugin_gdk.c
+  )
+
+  target_include_directories(gvplugin_gdk PRIVATE
+    ../../lib
+    ../../lib/cdt
+    ../../lib/cgraph
+    ../../lib/common
+    ../../lib/gvc
+    ../../lib/pathplan
+  )
+
+  target_include_directories(gvplugin_gdk SYSTEM PRIVATE
+    ${GDK_INCLUDE_DIRS}
+    ${GDK_PIXBUF_INCLUDE_DIRS}
+    ${PANGOCAIRO_INCLUDE_DIRS}
+  )
+
+  target_link_libraries(gvplugin_gdk
+    ${GDK_LIBRARIES}
+    ${GDK_PIXBUF_LIBRARIES}
+    ${PANGOCAIRO_LIBRARIES}
+  )
+
+  install(
+    TARGETS gvplugin_gdk
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+    LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+  )
+
+  set_target_properties(gvplugin_gdk 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_gdk PROPERTIES
+      RUNTIME_OUTPUT_NAME gvplugin_gdk-${GRAPHVIZ_PLUGIN_VERSION}
+    )
+  endif()
+
+endif()