Ask Your Question

Variable in export of package manifest

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

rado0x54 gravatar image


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

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

rado0x54 gravatar image


-DNX`getconf LONG_BIT`

solved the problem.

rospack cflags-only-other physx2_wrapper: 


edit flag offensive delete link more


Yep, that'll work. You can see the same pattern in the way we call things like `rosboost-cfg` (e.g.: 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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


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

Seen: 253 times

Last updated: Oct 05 '11