Skip to content

Commit

Permalink
Put the 'v' back in graphviz (#152)
Browse files Browse the repository at this point in the history
* Renamed the .cpp file.
* Add executable correctly spelling graphviz
* Add deprecation warning if the old executable name is used.

Signed-off-by: Jacob Perron <[email protected]>
  • Loading branch information
jacobperron authored Jan 15, 2021
1 parent afd0ae2 commit 99c6f58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions urdf_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ set_target_properties(urdfdom_model_state PROPERTIES SOVERSION ${URDF_MAJOR_MINO
add_executable(check_urdf src/check_urdf.cpp)
target_link_libraries(check_urdf urdfdom_model urdfdom_world)

add_executable(urdf_to_graphiz src/urdf_to_graphiz.cpp)
# Deprecated executable
add_executable(urdf_to_graphiz src/urdf_to_graphviz.cpp)
target_link_libraries(urdf_to_graphiz urdfdom_model)

add_executable(urdf_to_graphviz src/urdf_to_graphviz.cpp)
target_link_libraries(urdf_to_graphviz urdfdom_model)

# urdf_mem_test is a binary for testing, not a unit test
add_executable(urdf_mem_test test/memtest.cpp)
target_link_libraries(urdf_mem_test urdfdom_model)
Expand All @@ -35,7 +39,7 @@ endif()

INSTALL(TARGETS urdfdom_model DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(TARGETS urdfdom_world DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(TARGETS check_urdf urdf_to_graphiz urdf_mem_test
INSTALL(TARGETS check_urdf urdf_to_graphiz urdf_to_graphviz urdf_mem_test
DESTINATION ${CMAKE_INSTALL_BINDIR})
INSTALL(TARGETS urdfdom_sensor DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(TARGETS urdfdom_model_state DESTINATION ${CMAKE_INSTALL_LIBDIR})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,21 @@ void printTree(LinkConstSharedPtr link, string file)

int main(int argc, char** argv)
{
std::string executable_name(argv[0]);
std::string deprecated_name("urdf_to_graphiz");
if (deprecated_name == executable_name.substr(executable_name.size() - deprecated_name.size())) {
std::cerr << "WARNING: The executable named '" << deprecated_name
<< "' is deprecated. Use 'urdf_to_graphviz' instead." << std::endl;
}
if (argc < 2 || argc > 3) {
std::cerr << "Usage: urdf_to_graphiz input.xml [OUTPUT]"
std::cerr << "Usage: urdf_to_graphviz input.xml [OUTPUT]"
<< " Will create either $ROBOT_NAME.gv & $ROBOT_NAME.pdf in CWD"
<< " or OUTPUT.gv & OUTPUT.pdf." << std::endl;
return -1;
}
if (argc != 3) {
std::cerr << "WARNING: OUTPUT not given. This type of usage is deprecated!"
<< "Usage: urdf_to_graphiz input.xml [OUTPUT]"
<< "Usage: urdf_to_graphviz input.xml [OUTPUT]"
<< " Will create either $ROBOT_NAME.gv & $ROBOT_NAME.pdf in CWD"
<< " or OUTPUT.gv & OUTPUT.pdf." << std::endl;
}
Expand Down

0 comments on commit 99c6f58

Please sign in to comment.