From 9241eac8b3cea69cdea62d889e4c4620db384bea Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 19 Mar 2022 14:06:49 -0700 Subject: [PATCH] CMake: add cmd/edgepaint compilation Gitlab: #1836 --- CHANGELOG.md | 2 +- ci/tests.py | 1 - cmd/CMakeLists.txt | 1 + cmd/edgepaint/CMakeLists.txt | 55 ++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 cmd/edgepaint/CMakeLists.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 516681437..6bb4e69f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/ci/tests.py b/ci/tests.py index 753cacb14..39eea310d 100644 --- a/ci/tests.py +++ b/ci/tests.py @@ -103,7 +103,6 @@ def test_existence(binary: str): "diffimg", "dot_builtins", "dotty", - "edgepaint", "gv2gxl", "gvedit", "gvmap", diff --git a/cmd/CMakeLists.txt b/cmd/CMakeLists.txt index d23c934c1..2cead10fc 100644 --- a/cmd/CMakeLists.txt +++ b/cmd/CMakeLists.txt @@ -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 index 000000000..b9c678452 --- /dev/null +++ b/cmd/edgepaint/CMakeLists.txt @@ -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() -- 2.40.0