Skip to content
wjwwood edited this page Oct 9, 2011 · 5 revisions

ROS with Homebrew

Use Cases

Here are some scenarios for ROS and Homebrew interaction.

Installing a ros-dep

asdf

Running rosmake on a package that depends on a Keg only brew (tf)

User:

$ rosmake --rosdep-install tf

System:

Looks at /path/to/tf/pkg/manifest.xml for deps, like graphiz, and python-numpy
# inside rosmake (not rosdep)
for dep in deps:
    if type(dep) == HomebrewDependency:
        if dep.isSatisfied:
            if dep.isKegOnly:
                ROSMAKE_CMAKE_VARIABLES['CMAKE_MODULE_PATH'].append(subprocess.checkoutput(['brew', 'env-info', dep.name, '--cmake-module-path']))
                pkg_config_path = subprocess.checkoutput(['brew', 'env-info', dep.name, '--pkg-config-path'])
                ROSMAKE_CMAKE_VARIABLES['PKG_CONFIG_PATH'].append(pkg_config_path)
                ROSMAKE_ENV_VARIABLES['PKG_CONFIG_PATH'].append(pkg_config_path)
                ROSMAKE_ENV_VARIABLES['CFLAGS'].append(subprocess.checkoutput(['brew', 'env-info', dep.name, '--cflags']))
                ROSMAKE_ENV_VARIABLES['CXXFLAGS'].append(subprocess.checkoutput(['brew', 'env-info', dep.name, '--cxxflags']))
                ROSMAKE_ENV_VARIABLES['LDFLAGS'].append(subprocess.checkoutput(['brew', 'env-info', dep.name, '--ldflags']))

Then in the CMakeLists.txt they can use those CMAKE variables to call find() or run pkgconfig through cmake. Otherwise the env variables will make sure the library is found.


TinyXML installed via a brew tap, Keg only.

$ brew env-info tinyxml | xargs env rosmake

This will setup the environment to look in the Cellar for the keg only TinyXML.

Todo

Integrate brew env-info with rosmake/rosdep