Target dependent cmake flags [closed]

asked 2012-11-07 04:32:46 -0500

Arrakis gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-08-31 20:57:40.601531

Comments

Does rosbuild_remove_compile_flags work?

dornhege gravatar imagedornhege ( 2012-11-07 05:15:22 -0500 )edit

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

Arrakis gravatar imageArrakis ( 2012-11-07 06:56:11 -0500 )edit