Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Target dependent cmake flags

Hello all,

I have a project with multiple compilation units, compiled with the usual ROS CMakeLists.txt file. For one of my compilation units, I want to use a header file from an older version of a library that I am already using in the other units. To do this, I wanted to alter the compile flags in the "${pkg_name}_INCLUDE_DIRS"[1] cmake variable within the CMakeLists.txt script, for one specific target only. However it seems that every target gets compiled with the last value that the ${pkg_name}_INCLUDE_DIRS variable is set to within this script. Is there a way to alter this variable for just one target?

Thanks in Advance

[1] http://www.ros.org/wiki/rosbuild/CMakeLists#rosbuild_add_compile_flags