[ros-users] How to debug the source code in C?

Kei Okada k-okada at jsk.t.u-tokyo.ac.jp
Thu Aug 19 00:32:20 UTC 2010


Thanks for help, It works !

On Thu, Aug 19, 2010 at 6:20 AM, Brian Gerkey <gerkey at willowgarage.com> wrote:
> On Wed, Aug 18, 2010 at 1:07 PM, Kei Okada <k-okada at jsk.t.u-tokyo.ac.jp> wrote:
>> How to add compile definition with string variable, for example
>> -DFOO="bar" in rosbuild_add_compile_flags?
>>
>> I tried
>>
>>  set(COMPILE_FLAGS "-O2 -DFOO=\"bar\")
>>  rosbuild_add_compile_flags(hoge ${COMPILE_FLAGS})
>>
>> but, this did not works well, it seems compile with
>>  gcc -O2 -DFOO=bar.
>
> Here's how rosbuild does something similar, where PROJECT_NAME is an
> unquoted string:
>
>  add_definitions(-DROS_PACKAGE_NAME='\"${PROJECT_NAME}\"')
>
> Note the outer single quotes, and escaped double quotes.  I suspect
> that there are alternatives that would also work.
>
> Btw, CMake usually takes -D definitions via add_definitions(), as in
> this example.  But adding them via rosbuild_add_compile_flags() will
> also work.
>
>        brian.
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>



More information about the ros-users mailing list