]> granicus.if.org Git - graphviz/commitdiff
CMake: add a 'dot2gxl' symlink for 'gxl2gv', mimicking Autotools
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 14 Feb 2022 02:08:50 +0000 (13:08 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 15 Feb 2022 23:20:19 +0000 (10:20 +1100)
Gitlab: #1753, #1836

ci/tests.py
cmd/tools/CMakeLists.txt

index b700ded7ca619396cc7deb836fe746a400768355..5a2327a86b8f97163643c3300adea953ecbe4533 100644 (file)
@@ -97,7 +97,6 @@ def test_existence(binary: str):
   tools_not_built_with_cmake = [
     "cluster",
     "diffimg",
-    "dot2gxl",
     "dot_builtins",
     "dotty",
     "edgepaint",
index f8ec075c8db65430ab5b593b235717158c313d6d..7ab3d765932f220d2c94da6d390247385462eb7f 100644 (file)
@@ -305,6 +305,30 @@ if(EXPAT_FOUND)
 
   tool_defaults(gxl2gv)
 
+  set(DOT2GXL "${CMAKE_CURRENT_BINARY_DIR}/dot2gxl${CMAKE_EXECUTABLE_SUFFIX}")
+  if(WIN32 OR CYGWIN)
+    # copy instead of symlink to avoid
+    # https://gitlab.com/graphviz/graphviz/-/issues/2123
+    add_custom_command(
+      TARGET gxl2gv
+      POST_BUILD
+      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:gxl2gv> ${DOT2GXL}
+      COMMENT "Copying $<TARGET_FILE:gxl2gv> to ${DOT2GXL}")
+    install(
+      PROGRAMS ${DOT2GXL}
+      DESTINATION ${BINARY_INSTALL_DIR})
+  else()
+    add_custom_command(
+      TARGET gxl2gv
+      POST_BUILD
+      COMMAND ${CMAKE_COMMAND} -E create_symlink $<TARGET_FILE_NAME:gxl2gv>
+        ${DOT2GXL}
+      COMMENT "Linking $<TARGET_FILE_NAME:gxl2gv> as ${DOT2GXL}")
+    install(
+      FILES ${DOT2GXL}
+      DESTINATION ${BINARY_INSTALL_DIR})
+  endif()
+
 endif()
 
 # ==================================== mm2gv ===================================