No executable inside devel/lib/<package>
Hi everyone, I am having a little problem building a node. After I created and built the package, I sourced the setup.bash file. Then I added "src/camera.cpp" to the package. The CMakeList is:
cmake_minimum_required(VERSION 2.8.3)
project(chapter5_tutorials)
find_package(catkin REQUIRED
COMPONENTS
roscpp
message_generation
sensor_msgs
dynamic_reconfigure
driver_base
cv_bridge
image_transport
camera_info_manager
tf)
find_package(OpenCV REQUIRED)
generate_dynamic_reconfigure_options(
cfg/Camera.cfg
cfg/CameraStereo.cfg
cfg/Homography.cfg)
catkin_package(
CATKIN_DEPENDS
roscpp
message_runtime
sensor_msgs
dynamic_reconfigure
driver_base
cv_bridge
image_transport
camera_info_manager
tf)
include_directories(${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
add_executable(camera src/camera.cpp)
add_dependencies(camera ${PROJECT_NAME}_gencfg)
target_link_libraries(camera ${catkin_LIBRARIES})
add_executable(camera_timer src/camera_timer.cpp)
target_link_libraries(camera_timer ${catkin_LIBRARIES})
add_executable(camera_polling src/camera_polling.cpp)
target_link_libraries(camera_polling ${catkin_LIBRARIES})
add_executable(camera_stereo src/camera_stereo.cpp)
add_dependencies(camera_stereo ${PROJECT_NAME}_gencfg)
target_link_libraries(camera_stereo ${catkin_LIBRARIES})
add_executable(homography src/homography.cpp)
add_dependencies(homography ${PROJECT_NAME}_gencfg)
target_link_libraries(homography ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
install(TARGETS camera camera_timer camera_polling camera_stereo homography
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
foreach(dir bag config launch)
install(DIRECTORY ${dir}/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
endforeach(dir)
Then I use catkin_make again to build the package. The catkin_make output is:
Base path: /home/ally/dev/catkin_ws
Source space: /home/ally/dev/catkin_ws/src
Build space: /home/ally/dev/catkin_ws/build
Devel space: /home/ally/dev/catkin_ws/devel
Install space: /home/ally/dev/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ally/dev/catkin_ws/build"
####
####
#### Running command: "make -j1 -l1" in "/home/ally/dev/catkin_ws/build"
####
The catkin_make did not add targets to camera.cpp. I cannot find executable inside the devel/lib/<package> and therefore cannot run the node. Where could go wrong? Please help me out. Thank you:)
Can you please post your complete
CMakeLists.txt
(but without all the comments)? Please edit it into your original question.Also, please add the output of
catkin_make
.The
CMakeLists.txt
appears to be ok. To avoid transients, can you try to rebuild your workspace after arm -rf build && rm -rf devel
in yourcatkin_ws/
dir?Do any executables appear in
devel/lib/
? Can you show us your workspace layout and package structure?After removing build and devel folder, the catkin_make output is:
cannot find makefile?
Please add your workspace layout to your question. I'm beginning to suspect you don't have the expected file & directory layout in your workspace and / or not invoking commands in the correct locations.