]> granicus.if.org Git - graphviz/commitdiff
Add the `dot` executable to the CMake build
authorErwin Janssen <erwinjanssen@outlook.com>
Mon, 20 Mar 2017 12:07:01 +0000 (13:07 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Thu, 6 Apr 2017 19:38:02 +0000 (21:38 +0200)
The CMake build now builds `dot` and allows graphs to be rendered. Only
the `core` outputs and `dot_layout` are included for now.

CMakeLists.txt
cmd/CMakeLists.txt [new file with mode: 0644]
cmd/dot/CMakeLists.txt [new file with mode: 0644]

index 82b4d0a5de17f973b7d9ebdcaa94b487aecf157c..b1008c76328574fa483ebbe0a25a1437986e1b0b 100644 (file)
@@ -137,3 +137,4 @@ include(CPack)
 # ======================= Specify subdirectories to build ======================
 add_subdirectory(lib)
 add_subdirectory(plugin)
+add_subdirectory(cmd)
diff --git a/cmd/CMakeLists.txt b/cmd/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e05981e
--- /dev/null
@@ -0,0 +1 @@
+add_subdirectory(dot)
diff --git a/cmd/dot/CMakeLists.txt b/cmd/dot/CMakeLists.txt
new file mode 100644 (file)
index 0000000..017b35f
--- /dev/null
@@ -0,0 +1,41 @@
+add_definitions(-DDEMAND_LOADING=1)
+
+include_directories(
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_BINARY_DIR}
+    ${GRAPHVIZ_LIB_DIR}/cdt
+    ${GRAPHVIZ_LIB_DIR}/cgraph
+    ${GRAPHVIZ_LIB_DIR}/common
+    ${GRAPHVIZ_LIB_DIR}/gvc
+    ${GRAPHVIZ_LIB_DIR}/pathplan
+)
+
+add_executable(dot
+    # Source files
+    dot.c
+    no_builtins.c
+)
+
+target_link_libraries(dot
+    cgraph
+    gvc
+)
+
+# Link to math library
+if (UNIX)
+    target_link_libraries(dot m)
+endif (UNIX)
+
+# Installation location of library files
+install(
+    TARGETS dot
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+    LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+)
+
+# Specify man pages to be installed
+install(
+    FILES dot.1 osage.1 patchwork.1
+    DESTINATION ${MAN_INSTALL_DIR}
+)