]> granicus.if.org Git - graphviz/commitdiff
CMake: enable DevIL plugin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 1 Apr 2022 00:20:34 +0000 (17:20 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 2 Apr 2022 15:00:39 +0000 (08:00 -0700)
Gitlab: #1836

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

index 626ff9f4f95ddfcc61c7183843cc975986a25385..f003b3595af270ac01a066fbb23bba6c13d82cfc 100644 (file)
@@ -1,4 +1,5 @@
 add_subdirectory(core)
+add_subdirectory(devil)
 add_subdirectory(dot_layout)
 add_subdirectory(gd)
 add_subdirectory(gdiplus)
diff --git a/plugin/devil/CMakeLists.txt b/plugin/devil/CMakeLists.txt
new file mode 100644 (file)
index 0000000..004f571
--- /dev/null
@@ -0,0 +1,49 @@
+find_package(PANGOCAIRO)
+find_package(DevIL)
+
+if(PANGOCAIRO_FOUND AND DevIL_FOUND)
+
+  add_library(gvplugin_devil SHARED
+    gvdevice_devil.c
+    gvplugin_devil.c
+  )
+
+  target_include_directories(gvplugin_devil 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_devil SYSTEM PRIVATE
+    ${PANGOCAIRO_INCLUDE_DIRS}
+    ${DevIL_INCLUDE_DIRS}
+  )
+
+  target_link_libraries(gvplugin_devil
+    ${PANGOCAIRO_LIBRARIES}
+    ${DevIL_LIBRARIES}
+  )
+
+  install(
+    TARGETS gvplugin_devil
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+    LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+  )
+
+  set_target_properties(gvplugin_devil 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_devil PROPERTIES
+      RUNTIME_OUTPUT_NAME gvplugin_devil-${GRAPHVIZ_PLUGIN_VERSION}
+    )
+  endif()
+
+endif()