From: Matthew Fernandez Date: Wed, 6 Apr 2022 03:00:12 +0000 (-0700) Subject: CMake: enable Quartz plugin X-Git-Tag: 4.0.0~120^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8de39982e5ac0b2adff6b7819fa8b9412bb835c0;p=graphviz CMake: enable Quartz plugin It is unclear how valuable this is, given this is only applicable to macOS and its dependency discovery (based on the Autotools behavior) is fairly ad hoc. But we still drag it into the CMake world to make progress on unifying the Graphviz build system. Gitlab: #1836 --- diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index 2c958466e..e2c83a1a3 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -10,6 +10,7 @@ add_subdirectory(gtk) add_subdirectory(neato_layout) add_subdirectory(pango) add_subdirectory(poppler) +add_subdirectory(quartz) add_subdirectory(rsvg) add_subdirectory(webp) add_subdirectory(xlib) diff --git a/plugin/quartz/CMakeLists.txt b/plugin/quartz/CMakeLists.txt new file mode 100644 index 000000000..8653ca672 --- /dev/null +++ b/plugin/quartz/CMakeLists.txt @@ -0,0 +1,53 @@ +if(IS_DIRECTORY "/System/Library/Frameworks/ApplicationServices.framework") + + add_library(gvplugin_quartz SHARED + gvplugin_quartz.h + GVTextLayout.h + gvdevice_quartz.c + gvloadimage_quartz.c + gvplugin_quartz.c + gvrender_quartz.c + gvtextlayout_quartz.c + GVTextLayout.m + ) + + target_include_directories(gvplugin_quartz PRIVATE + ../../lib + ../../lib/cdt + ../../lib/cgraph + ../../lib/common + ../../lib/gvc + ../../lib/pathplan + ) + + target_link_libraries(gvplugin_quartz + cgraph + gvc + ) + + # `target_link_options` is only available ≥ CMake 3.13, but this plugin is + # only enabled on macOS where we can rely on an up to date CMake + target_link_options(gvplugin_quartz PUBLIC + -framework ApplicationServices + ) + + install( + TARGETS gvplugin_quartz + RUNTIME DESTINATION ${BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} + ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR} + ) + + set_target_properties(gvplugin_quartz 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_quartz PROPERTIES + RUNTIME_OUTPUT_NAME gvplugin_quartz-${GRAPHVIZ_PLUGIN_VERSION} + ) + endif() + +endif()