Target dependent cmake flags [closed]
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
Does rosbuild_remove_compile_flags work?
rosbuild_add_compile_flags (and rosbuild_remove_compile_flags) seem to adjust the ${COMPILE_FLAGS} variable, which appends the include directory to the end of the list. I need my stuff added to the start of the list. This is why I am adjusting the ${pkg_name}_INCLUDE_DIRS variable