]> granicus.if.org Git - graphviz/commitdiff
CMake: enable WebP plugin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 31 Mar 2022 03:49:05 +0000 (20:49 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 2 Apr 2022 00:07:11 +0000 (17:07 -0700)
Gitlab: #1836

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

index 626ff9f4f95ddfcc61c7183843cc975986a25385..4e025db93ada820a001f278823768e4f9421787f 100644 (file)
@@ -4,3 +4,4 @@ add_subdirectory(gd)
 add_subdirectory(gdiplus)
 add_subdirectory(neato_layout)
 add_subdirectory(pango)
+add_subdirectory(webp)
diff --git a/plugin/webp/CMakeLists.txt b/plugin/webp/CMakeLists.txt
new file mode 100644 (file)
index 0000000..cade39d
--- /dev/null
@@ -0,0 +1,38 @@
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+  pkg_check_modules(WEBP libwebp)
+endif()
+
+if(WEBP_FOUND)
+
+  add_library(gvplugin_webp SHARED
+    gvplugin_webp.c
+    gvloadimage_webp.c
+    gvdevice_webp.c
+  )
+
+  target_include_directories(gvplugin_webp PRIVATE
+    ${GRAPHVIZ_LIB_DIR}
+    ${GRAPHVIZ_LIB_DIR}/cdt
+    ${GRAPHVIZ_LIB_DIR}/cgraph
+    ${GRAPHVIZ_LIB_DIR}/common
+    ${GRAPHVIZ_LIB_DIR}/gvc
+    ${GRAPHVIZ_LIB_DIR}/pathplan
+  )
+
+  target_include_directories(gvplugin_webp SYSTEM PRIVATE
+    ${WEBP_INCLUDE_DIRS}
+  )
+
+  target_link_libraries(gvplugin_webp
+    ${WEBP_LINK_LIBRARIES}
+  )
+
+  install(
+    TARGETS gvplugin_webp
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+    LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+  )
+
+endif()