### Changed
-- the `mingle` and `edgepaint` binaries are now included in the CMake build
+- the `mingle`, `diffimg`, and `edgepaint` binaries are now included in the
+ CMake build system
- a brief note about the (previously undocumented) behavior of Graphviz when
sent `SIGUSR1` is now mentioned in the man page
Include(CTest)
# ======================= Specify subdirectories to build ======================
+add_subdirectory(contrib/diffimg)
add_subdirectory(lib)
add_subdirectory(plugin)
add_subdirectory(cmd)
tools_not_built_with_cmake = [
"cluster",
- "diffimg",
"dot_builtins",
"dotty",
"gv2gxl",
check_that_tool_does_not_exist(binary, os_id)
pytest.skip(f"{binary} is not built on some Windows due to lacking libANN")
+ if binary == "diffimg" and is_win64():
+ check_that_tool_does_not_exist(binary, os_id)
+ pytest.skip(f"{binary} is not built on 64-bit Windows due to lacking libgd")
+
assert shutil.which(binary) is not None
def check_that_tool_does_not_exist(tool, os_id):
--- /dev/null
+find_package(GD)
+
+if(GD_FOUND)
+
+ add_executable(diffimg diffimg.c)
+ target_include_directories(diffimg PRIVATE ${GRAPHVIZ_LIB_DIR})
+ target_include_directories(diffimg SYSTEM PRIVATE ${GD_INCLUDE_DIRS})
+ target_link_libraries(diffimg ${GD_LIBRARIES})
+
+ install(
+ TARGETS diffimg
+ RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+ LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+ )
+
+ if(GZIP)
+ add_custom_target(man-diffimg ALL DEPENDS diffimg.1.gz
+ COMMENT "diffimg man page")
+ add_custom_command(
+ OUTPUT diffimg.1.gz
+ COMMAND ${GZIP} -9 --no-name --to-stdout diffimg.1
+ >"${CMAKE_CURRENT_BINARY_DIR}/diffimg.1.gz"
+ MAIN_DEPENDENCY diffimg.1
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "compress diffimg man page")
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/diffimg.1.gz
+ DESTINATION ${MAN_INSTALL_DIR}/man1)
+ else()
+ install(
+ FILES diffimg.1
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ )
+ endif()
+
+endif()
returncode = 0 if a.strip() == b.strip() else -1
elif F == "png":
# FIXME: remove when https://gitlab.com/graphviz/graphviz/-/issues/1788 is fixed
- if os.environ.get("build_system") == "cmake":
+ if os.environ.get("build_system") == "cmake" and \
+ platform.system() == "Windows":
print(f"Warning: Skipping PNG image comparison for test {testname}:"
- f"{subtest_index} : format: {fmt} because CMake builds does not "
- "contain the diffimg utility (#1788)",
+ f"{subtest_index} : format: {fmt} because CMake builds on Windows "
+ "do not contain the diffimg utility (#1788)",
file=sys.stderr)
return
returncode = subprocess.call(
print("Could not find a value for DIFFIMG", file=sys.stderr)
# FIXME: Remove workaround for missing diffimg when
# https://gitlab.com/graphviz/graphviz/-/issues/1788 is fixed
- if os.environ.get("build_system") != "cmake":
+ if os.environ.get("build_system") != "cmake" or \
+ platform.system() != "Windows":
sys.exit(1)
# sys.exit(1)