]> granicus.if.org Git - graphviz/commitdiff
CMake: add cmd/edgepaint compilation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Mar 2022 21:06:49 +0000 (14:06 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Mar 2022 01:46:43 +0000 (18:46 -0700)
Gitlab: #1836

CHANGELOG.md
ci/tests.py
cmd/CMakeLists.txt
cmd/edgepaint/CMakeLists.txt [new file with mode: 0644]

index 51668143795c894f399ba02a4c342f0a0a40e110..6bb4e69f9d0aad692f65fd0d2815e158470c7d1d 100644 (file)
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ### Changed
 
-- the `mingle` binary is now included in the CMake build
+- the `mingle` and `edgepaint` binaries are now included in the CMake build
 - a brief note about the (previously undocumented) behavior of Graphviz when
   sent `SIGUSR1` is now mentioned in the man page
 
index 753cacb14e089b180e4c800e48e011a3e120c41d..39eea310d5736a48c933fd3c195f3113af1b1703 100644 (file)
@@ -103,7 +103,6 @@ def test_existence(binary: str):
     "diffimg",
     "dot_builtins",
     "dotty",
-    "edgepaint",
     "gv2gxl",
     "gvedit",
     "gvmap",
index d23c934c1baf9d41c9e8c23e4e88f2fa37ad725c..2cead10fc2aad72f7bebf288f687a48d5ae4940f 100644 (file)
@@ -1,4 +1,5 @@
 add_subdirectory(dot)
+add_subdirectory(edgepaint)
 add_subdirectory(gvpr)
 add_subdirectory(mingle)
 add_subdirectory(tools)
diff --git a/cmd/edgepaint/CMakeLists.txt b/cmd/edgepaint/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b9c6784
--- /dev/null
@@ -0,0 +1,55 @@
+if(with_sfdp)
+
+  add_executable(edgepaint edgepaintmain.c)
+
+  target_include_directories(edgepaint PRIVATE
+    ${GRAPHVIZ_LIB_DIR}
+    ${GRAPHVIZ_LIB_DIR}/common
+    ${GRAPHVIZ_LIB_DIR}/cgraph
+    ${GRAPHVIZ_LIB_DIR}/cdt
+    ${GETOPT_INCLUDE_DIRS}
+  )
+
+  target_link_libraries(edgepaint PRIVATE
+    cdt
+    cgraph
+    edgepaintlib
+    gvc
+    ingraphs
+    neatogen
+    rbtree
+    sfdpgen
+    sparse
+    ${MATH_LIB}
+  )
+
+  if(NOT HAVE_GETOPT_H)
+    target_link_libraries(edgepaint PRIVATE ${GETOPT_LINK_LIBRARIES})
+  endif()
+
+  install(
+    TARGETS edgepaint
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+  )
+
+  if(GZIP)
+    add_custom_target(man-edgepaint ALL DEPENDS edgepaint.1.gz
+                      COMMENT "edgepaint man page")
+    add_custom_command(
+      OUTPUT edgepaint.1.gz
+      COMMAND ${GZIP} -9 --no-name --to-stdout edgepaint.1
+        >"${CMAKE_CURRENT_BINARY_DIR}/edgepaint.1.gz"
+      MAIN_DEPENDENCY edgepaint.1
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      COMMENT "compress edgepaint man page")
+    install(
+      FILES ${CMAKE_CURRENT_BINARY_DIR}/edgepaint.1.gz
+      DESTINATION ${MAN_INSTALL_DIR}/man1)
+  else()
+    install(
+      FILES edgepaint.1
+      DESTINATION ${MAN_INSTALL_DIR}/man1
+    )
+  endif()
+
+endif()