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 -0600
Seen: 4,536 times
Last updated: Feb 23 '11
How to cross-compile ROS for BeagleBoard-xM (ARM)
Creating a ROS optional Library
Replacing wrapper ROS package for external library - best practices?
CMake Error in Netbeans (double-check your ROS_PACKAGE_PATH)
How does ROS build system work?
how to compile package with debug option
Cleaning up when moving a stack/package to a different directory so rosmake won't complain
Error while installing ROS Base Install from SVN on Ubuntu (BeagleBoard)