1
$\begingroup$

Rosanswers logo

As we know, each ROS package contains these two files: package.xml and CMakeLists.txt.

I don't understand exactly how they works together.

For example, the package.xml of the package actionlib shows us that it depends on python-wxtools because it conains such a line:

<exec_depend>python-wxtools</exec_depend> 

However, after reading the file CMakeLists.txt of the package actionlib, I don't see that it depends on python-wxtools. Here is the CMakeLists.txt of actionlib:

find_package(catkin REQUIRED COMPONENTS actionlib_msgs message_generation roscpp rosunit std_msgs) find_package(Boost REQUIRED COMPONENTS thread) include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) link_directories(${catkin_LIBRARY_DIRS}) catkin_python_setup() add_action_files(DIRECTORY action FILES Test.action TestRequest.action TwoInts.action) generate_messages(DEPENDENCIES actionlib_msgs std_msgs) catkin_package( INCLUDE_DIRS include LIBRARIES actionlib CATKIN_DEPENDS actionlib_msgs message_runtime roscpp std_msgs DEPENDS Boost ) add_library(actionlib src/connection_monitor.cpp src/goal_id_generator.cpp) target_link_libraries(actionlib ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_dependencies(actionlib actionlib_gencpp) catkin_install_python(PROGRAMS tools/axclient.py tools/axserver.py tools/dynamic_action.py tools/library.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}) install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} FILES_MATCHING PATTERN "*.h") if(CATKIN_ENABLE_TESTING) find_package(rostest) add_subdirectory(test) endif() 

Originally posted by bear234 on ROS Answers with karma: 71 on 2018-05-26

Post score: 0

$\endgroup$

1 Answer 1

1
$\begingroup$

Rosanswers logo

Taken from package.xml

This file defines properties about the package such as the package name, version numbers, authors, maintainers, and dependencies on other catkin packages.

but the critical part is about package.xml

Your system package dependencies are declared in package.xml. If they are missing or incorrect, you may be able to build from source and run tests on your own machine, but your package will not work correctly when released to the ROS community. Others depend on this information to install the software they need for using your package.

Execution Dependencies specify which packages are needed to run code in this package. This is the case when you depend on shared libraries in this package (especially when these packages are declared as (CATKIN_)DEPENDS in catkin_package() in CMake).

There is a problem with Cmakefile I guess, they should have added python-wxtools in CATKIN_DEPENDS in catkin_package


Originally posted by cagatay with karma: 1850 on 2018-05-26

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by gvdhoorn on 2018-05-26:
Additional info: #q217475 (and #q215059).

$\endgroup$