catkin: Node is build in wrong place
I have the following CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(netft_rdt_driver)
find_package(catkin REQUIRED COMPONENTS roscpp diagnostic_updater diagnostic_msgs geometry_msgs roscpp_serialization)
find_package(Boost REQUIRED COMPONENTS system thread program_options)
include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
add_library(${PROJECT_NAME} src/netft_rdt_driver.cpp)
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})
add_executable(netft_node src/netft_node.cpp)
target_link_libraries(netft_node ${PROJECT_NAME})
target_link_libraries(netft_node ${Boost_LIBRARIES})
target_link_libraries(netft_node ${catkin_LIBRARIES})
catkin_package(
DEPENDS roscpp diagnostic_updater diagnostic_msgs geometry_msgs
CATKIN_DEPENDS roscpp diagnostic_updater diagnostic_msgs geometry_msgs
LIBRARIES ${PROJECT_NAME}
)
The problem is that the executable netft_node does not goes to the usual devel/lib/pkg_name/.
but to the build/netft/netft_rdt_driver
and rosrun
can't find it there. Any idea where is the problem?
Btw you don't have to list the exported dependencies twice - once under DEPENDS and once under CATKIN_DEPENDS. Since all packages listed there are catkin packages you should only list them as CATKIN_DEPENDS and remove DEPENDS completely.