How to add additional compile flags
For the ARM build of the PCL_ROS package to work I need to add some additional compiler (gcc / g++) flags. What is the right way to do it?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
For the ARM build of the PCL_ROS package to work I need to add some additional compiler (gcc / g++) flags. What is the right way to do it?
See the rosbuild/CmakeLists docs.
In particular, the rosbuild_add_compile_flags
and rosbuild_remove_compile_flags
macros are likely what you want.
$ROS_ROOT/core/rosbuild/rosconfig.cmake is where ros configuration starts. There are three places ros looks for rosconfig.cmake, and if you parse rosbuild's rosconfig.cmake, you'll find it essentially does the following:
If neither of the above are found, or not all configuration variables are set:
If you're cross compiling and want to add cpu specific flags globally, you may want to use eric's suggestion and include them in $ROS_ROOT/rosconfig.cmake. This is neater as it is under your control and avoids hacking someone else's CMakeLists.txt files (which will disappear next time you install).
If you need it for a certain package only, then that would be the only way to go, though I'd suggest finding a way to upstream the changes so others can benefit as well.
Asked: 2011-02-23 08:40:29 -0500
Seen: 4,446 times
Last updated: Feb 23 '11
Freenect_launch does not detect Kinect, BeagleBoard-xM, Ubuntu [closed]
Compiling ros node with cmake and swi-prolog
rosbuild_add_roslaunch_check(..) and required arguments
Catkin_make optimization flags
catkin build with cmake file and flags
Use a Robotis OpenCM9.04 board to control a Trutlebot arm