Please help out. Its Cmakelist, Cmake error. I heard related articles to this but I couldnot solve it.
Im using ROS kinetic and trying to build my first HelloROS.cpp with rosserial_embeddedlinux package. I couldnot compile the package, (I dont know how to write a makefile or makefile is generated automatically after cmake )
this is the error: Whenever i try to cmake,
/HelloROS.cpp:6:17: fatal error: ros.h: No such file or directory
compilation terminated.
CMakeFiles/HelloROS.dir/build.make:62: recipe for target 'CMakeFiles/HelloROS.dir/examples/HelloRos/HelloROS.cpp.o' failed
make[2]: *** [CMakeFiles/HelloROS.dir/examples/HelloRos/HelloROS.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/HelloROS.dir/all' failed
make[1]: *** [CMakeFiles/HelloROS.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
This is my cmakelist.txt:
cmake_minimum_required(VERSION 2.8.3)
project(rosserial_embeddedlinux)
find_package(catkin REQUIRED COMPONENTS rosserial_client roscpp rospy sensor_msgs std_msgs
)
catkin_package(
CATKIN_DEPENDS roscpp rospy
LIBRARIES ${PROJECT_NAME}/src/ros_lib)
include_directories(include ${catkin_INCLUDE_DIRS}
${rosserial_client_INCLUDE_DIRS}
${roscpp_INCLUDE_DIRS}
${ros_lib_INCLUDE_DIRS})
add_executable(HelloROS src/examples/HelloRos/HelloROS.cpp)
target_link_libraries(HelloROS ${catkin_LIBRARIES})
install(
DIRECTORY src/ros_lib
src/examples
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/src
FILES_MATCHING PATTERN "*.h"
)
catkin_install_python(
PROGRAMS src/${PROJECT_NAME}/make_libraries.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
and
this is my package.xml
<package>
<name>rosserial_embeddedlinux</name>
<version>0.7.7</version>
<description>
rosserial for embedded Linux enviroments
</description>
<author>xx</author>
<maintainer email="xx@gmail.com">xx</maintainer>
<maintainer email="xx@.com">xx</maintainer>
<license>BSD</license>
<url>http://ros.org/wiki/rosserial_embeddedlinux</url>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>rosserial_client</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>rosserial_msgs</run_depend>
</package>
Please out my issue.