ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

The preferred approach is to modify the package's CMakeLists.txt to change the compile options:

set_directory_properties(PROPERTIES COMPILE_OPTIONS "-pg")

This will modify the compile options for the whole package, but won't bleed into other packages accidentally due to cmake include.

There's also ways to modify compile options per target (so just for one library or executable), see https://stackoverflow.com/questions/23995019/what-is-the-modern-method-for-setting-general-compile-flags-in-cmake