From: Matthew Fernandez Date: Thu, 31 Mar 2022 03:49:05 +0000 (-0700) Subject: CMake: enable WebP plugin X-Git-Tag: 4.0.0~146^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=645817efcb9926bdd42f3616eb52e8ea5c199283;p=graphviz CMake: enable WebP plugin Gitlab: #1836 --- diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index 626ff9f4f..4e025db93 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -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 index 000000000..cade39dbb --- /dev/null +++ b/plugin/webp/CMakeLists.txt @@ -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()