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

Variable in export of package manifest

asked 2011-10-04 23:06:53 -0600

rado0x54 gravatar image

Hi,

I have a quick question about the neat wrapping of an external library. I'm wrapping PhysX into a ros package and would need an variable export of a cflag depending of the word-length of the host system.

cpp cflags="-I${prefix}/include/SDKs/Cooking/include -I${prefix}/include/SDKs/Foundation/include -I${prefix}/include/SDKs/NxCharacter/include -I${prefix}/include/SDKs/Physics/include -I${prefix}/include/SDKs/PhysXLoader/include" lflags="-L${prefix}/lib -Wl,-rpath,${prefix}/lib -lNxCharacter -lNxCooking -lPhysXCore -lPhysXLoader"

Now I want to add a flag -DNX32 or -DNX64 bit to the cflags depending on the host system. (The Makefile installs PhysX binaries automatically for 32bit and 64 bit systems into the package).

Any suggestions on how to nicely do this? Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-10-05 02:01:17 -0600

rado0x54 gravatar image

Adding

-DNX`getconf LONG_BIT`

solved the problem.

rospack cflags-only-other physx2_wrapper: 
-DNX64

Thanks.

edit flag offensive delete link more

Comments

Yep, that'll work. You can see the same pattern in the way we call things like `rosboost-cfg` (e.g.: https://code.ros.org/svn/ros/stacks/ros_comm/trunk/clients/cpp/roscpp/manifest.xml). But I'll note that this backdoor, where we let `bash` chew on the export flags, is highly non-portable, and will go away with the advent of `rosbuild2`.
Brian Gerkey gravatar image Brian Gerkey  ( 2011-10-05 04:01:52 -0600 )edit

Question Tools

Stats

Asked: 2011-10-04 23:06:53 -0600

Seen: 399 times

Last updated: Oct 05 '11