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

Revision history [back]

click to hide/show revision 1
initial version

Not really an answer (I do think you can use CFG_EXTRAS for this btw), but afaik packages are not supposed to to use (or at least, I think it will not be releasable) anything but C++03 (from REP3, Rationale, C++):

We use the C++03 (ISO/IEC 14882:2003) standard [..]

Use of C++[0|1]x or tr1 features are only allowed if support for that feature is checked at compile time, and equivalent functionality exists without requiring C++[0|1]x code. A wholesale jump to C++[0|1]x will not happen until all commonly used OS platforms fully support it.

Not really an answer (I do think you can use CFG_EXTRAS for this btw), but afaik packages are not supposed to to use (or at least, I think it will not be releasable) anything but C++03 (from REP3, Rationale, C++):

We use the C++03 (ISO/IEC 14882:2003) standard [..]

Use of C++[0|1]x or tr1 features are only allowed if support for that feature is checked at compile time, and equivalent functionality exists without requiring C++[0|1]x code. A wholesale jump to C++[0|1]x will not happen until all commonly used OS platforms fully support it.

There have been numerous questions regarding updating REP3 though, see for instance Revisit REP3 with respect to C++11?.

Not really an answer (I do think you can use CFG_EXTRAS for this btw), but afaik packages are not supposed to to use (or at least, I think it will not be releasable) anything but C++03 (from REP3, Rationale, C++):

We use the C++03 (ISO/IEC 14882:2003) standard [..]

Use of C++[0|1]x or tr1 features are only allowed if support for that feature is checked at compile time, and equivalent functionality exists without requiring C++[0|1]x code. A wholesale jump to C++[0|1]x will not happen until all commonly used OS platforms fully support it.

There have been numerous questions regarding updating REP3 though, see for instance Revisit REP3 with respect to C++11?.


Edit: CFG_EXTRAS expects to be passed a path to a file (see the catkin_package() doc). This file may contain any combination of valid CMake statements. You could for instance set(..) a MY_PKG_CXX_FLAGS or similar, which exports your specific flags. The contents of the file is automatically loaded whenever someone depends on your package (ie, via find_package(YOUR_PKG) or as a component in find_package(catkin REQUIRED COMPONENTS ..)).

All they would then have to do would be to append your flags to the CMAKE_CXX_FLAGS for instance.

PS: it might be worthwhile to check whether CMake or catkin has some best practices defined regarding naming of .._CXX_FLAGS and / or appending to the CMAKE_CXX_FLAGS variable(s).