]> granicus.if.org Git - graphviz/commitdiff
CMake: enable GTK plugin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 3 Apr 2022 22:19:54 +0000 (15:19 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 10 Apr 2022 05:41:56 +0000 (22:41 -0700)
Gitlab: #1836

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

index 81f952b3dfd0166973ee42658b90891e604c6da1..2c958466ebc5e34e27bf8d4f1faa95089fc3e320 100644 (file)
@@ -6,6 +6,7 @@ add_subdirectory(gdiplus)
 add_subdirectory(gdk)
 add_subdirectory(glitz)
 add_subdirectory(gs)
+add_subdirectory(gtk)
 add_subdirectory(neato_layout)
 add_subdirectory(pango)
 add_subdirectory(poppler)
diff --git a/plugin/gtk/CMakeLists.txt b/plugin/gtk/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9ee411f
--- /dev/null
@@ -0,0 +1,49 @@
+find_package(GTK2)
+
+if(GTK2_FOUND)
+
+  add_library(gvplugin_gtk SHARED
+    callbacks.c
+    gvdevice_gtk.c
+    gvplugin_gtk.c
+    interface.c
+    support.c
+  )
+
+  target_include_directories(gvplugin_gtk PRIVATE
+    ../../lib
+    ../../lib/cdt
+    ../../lib/cgraph
+    ../../lib/common
+    ../../lib/gvc
+    ../../lib/pathplan
+  )
+
+  target_include_directories(gvplugin_gtk SYSTEM PRIVATE
+    ${GTK2_INCLUDE_DIRS}
+  )
+
+  target_link_libraries(gvplugin_gtk
+    ${GTK2_LIBRARIES}
+  )
+
+  install(
+    TARGETS gvplugin_gtk
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+    LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+  )
+
+  set_target_properties(gvplugin_gtk 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_gtk PROPERTIES
+      RUNTIME_OUTPUT_NAME gvplugin_gtk-${GRAPHVIZ_PLUGIN_VERSION}
+    )
+  endif()
+
+endif()