]> granicus.if.org Git - graphviz/commitdiff
CMake: add Glitz plugin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 3 Apr 2022 19:29:44 +0000 (12:29 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 8 Apr 2022 00:17:54 +0000 (17:17 -0700)
Gitlab: #1836

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

index 16a41b4193a750bd20f8420e09e7b18a3323eeee..6f31f36aa5eafcc10c643aef7a1f76db379e02ed 100644 (file)
@@ -3,6 +3,7 @@ add_subdirectory(devil)
 add_subdirectory(dot_layout)
 add_subdirectory(gd)
 add_subdirectory(gdiplus)
+add_subdirectory(glitz)
 add_subdirectory(gs)
 add_subdirectory(neato_layout)
 add_subdirectory(pango)
diff --git a/plugin/glitz/CMakeLists.txt b/plugin/glitz/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1901c34
--- /dev/null
@@ -0,0 +1,52 @@
+find_package(PANGOCAIRO)
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+  pkg_check_modules(GLITZ glitz)
+endif()
+
+if(GLITZ_FOUND AND PANGOCAIRO_FOUND)
+
+  add_library(gvplugin_glitz SHARED
+    gvdevice_glitz.c
+    gvplugin_glitz.c
+  )
+
+  target_include_directories(gvplugin_glitz PRIVATE
+    ../../lib
+    ../../lib/cdt
+    ../../lib/cgraph
+    ../../lib/common
+    ../../lib/gvc
+    ../../lib/pathplan
+  )
+
+  target_include_directories(gvplugin_glitz SYSTEM PRIVATE
+    ${GLITZ_INCLUDE_DIRS}
+    ${PANGOCAIRO_INCLUDE_DIRS}
+  )
+
+  target_link_libraries(gvplugin_glitz
+    ${GLITZ_LIBRARIES}
+    ${PANGOCAIRO_LIBRARIES}
+  )
+
+  install(
+    TARGETS gvplugin_glitz
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+    LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+  )
+
+  set_target_properties(gvplugin_glitz 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_glitz PROPERTIES
+      RUNTIME_OUTPUT_NAME gvplugin_glitz-${GRAPHVIZ_PLUGIN_VERSION}
+    )
+  endif()
+
+endif()