Re: Export CMake file only to dependent packages

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: Export CMake file only to dependent packages

Brian Gerkey

On Jan 14, 2010, at 5:45 PM, Nicholas Butko wrote:

> For me, I am currently using to export a library of .jar files. My  
> exported cmake file looks like this:
> ----
> rosbuild_find_ros_package(externalLibs)
> add_jar_dir(${externalLibs_PACKAGE_PATH}/jar)
> ----
> This tells all packages that depend on externalLibs that they should  
> link to the jar files in that directory. This takes the burden off  
> my fellow developers  to find and link to the libraries they require.
> Another solution to this would be to modify rosjava.cmake to process  
> some similar kind of export from the manifest... something like
> ----
> <export> <rosjava jardir=${prefix}/jar"/></export>
> ----
> How would I add this kind of functionality to rosjava.cmake?

I would go instead with the following, which is more parallel with cpp  

<export> <java jardir=${prefix}/jar"/></export>

Then you want to call `rospack export --lang=java --attrib=jardir  
PKG`, which will collect all the exported jardir values from the  
packages on with PKG depends (but not those exported by PKG itself).

To make that call from CMake (e.g., from rosjava.cmake), do something  
like this:

  rosbuild_invoke_rospack(${PROJECT_NAME} _rosjava JARDIR export --
lang=java --attrib=jardir)

Then you would refer to the collected flags (if any) as $
{_rosjava_JARDIR}.  See the docs for details on  


Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
ros-users mailing list
[hidden email]