From: Erwin Janssen Date: Mon, 20 Mar 2017 12:07:01 +0000 (+0100) Subject: Add the `dot` executable to the CMake build X-Git-Tag: 2.42.0~183^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15bc27143d14abf98de9aceb5ff03d77591c2cf4;p=graphviz Add the `dot` executable to the CMake build The CMake build now builds `dot` and allows graphs to be rendered. Only the `core` outputs and `dot_layout` are included for now. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 82b4d0a5d..b1008c763 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 index 000000000..e05981ed8 --- /dev/null +++ b/cmd/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(dot) diff --git a/cmd/dot/CMakeLists.txt b/cmd/dot/CMakeLists.txt new file mode 100644 index 000000000..017b35f04 --- /dev/null +++ b/cmd/dot/CMakeLists.txt @@ -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} +)