]> granicus.if.org Git - graphviz/commitdiff
CMake: add Lasi plugin
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 3 Apr 2022 22:28:59 +0000 (15:28 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 10 Apr 2022 23:39:54 +0000 (16:39 -0700)
Gitlab: #1836

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

index e2c83a1a30ef7b619a1fb61262faaf22028d1d17..4c959d9e239bcfa89ede3db24d83bb50c42706ff 100644 (file)
@@ -7,6 +7,7 @@ add_subdirectory(gdk)
 add_subdirectory(glitz)
 add_subdirectory(gs)
 add_subdirectory(gtk)
+add_subdirectory(lasi)
 add_subdirectory(neato_layout)
 add_subdirectory(pango)
 add_subdirectory(poppler)
diff --git a/plugin/lasi/CMakeLists.txt b/plugin/lasi/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2655b36
--- /dev/null
@@ -0,0 +1,57 @@
+find_package(Freetype)
+find_package(PANGOCAIRO)
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+  pkg_check_modules(LASI lasi)
+endif()
+
+if(Freetype_FOUND AND LASI_FOUND AND PANGOCAIRO_FOUND)
+
+  add_library(gvplugin_lasi SHARED
+    gvloadimage_lasi.c
+    gvplugin_lasi.c
+    gvrender_lasi.cpp
+  )
+
+  target_include_directories(gvplugin_lasi PRIVATE
+    ../../lib
+    ../../lib/cdt
+    ../../lib/cgraph
+    ../../lib/common
+    ../../lib/gvc
+    ../../lib/pathplan
+  )
+
+  target_include_directories(gvplugin_lasi SYSTEM PRIVATE
+    ${Freetype_INCLUDE_DIRS}
+    ${LASI_INCLUDE_DIRS}
+    ${PANGOCAIRO_INCLUDE_DIRS}
+  )
+
+  target_link_libraries(gvplugin_lasi
+    ${Freetype_LIBRARIES}
+    ${LASI_LIBRARIES}
+    ${MATH_LIB}
+    ${PANGOCAIRO_LIBRARIES}
+  )
+
+  install(
+    TARGETS gvplugin_lasi
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+    LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+  )
+
+  set_target_properties(gvplugin_lasi 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_lasi PROPERTIES
+      RUNTIME_OUTPUT_NAME gvplugin_lasi-${GRAPHVIZ_PLUGIN_VERSION}
+    )
+  endif()
+
+endif()