Skip to content

Commit

Permalink
Added a Catkin env hook to set OPENRAVE_PLUGINS.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Koval committed Mar 20, 2016
1 parent e2e720e commit c4bf2e5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Expand Up @@ -5,7 +5,7 @@ set(USE_CATKIN 1 CACHE BOOL "Build or_fcl as a Catkin package.")

include(FindPkgConfig)
include(CheckCXXSourceCompiles)
include(cmake/CXX11.cmake)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CXX11.cmake")

find_package(Boost REQUIRED COMPONENTS system)
find_package(OpenRAVE REQUIRED)
Expand Down Expand Up @@ -58,10 +58,14 @@ if (${USE_CATKIN})
find_package(catkin)
if (NOT "${catkin_FOUND}")
message(FATAL_ERROR "Unable to find Catkin. Did you forget to pass"
" -DUSE_CATKIN=0 to disable Catkin support.")
" -DUSE_CATKIN=0 to disable Catkin support?")
endif ()

catkin_package()
catkin_add_env_hooks("20.${PROJECT_NAME}"
SHELLS sh
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/catkin-env-hooks"
)

if (CATKIN_ENABLE_TESTING)
catkin_add_nosetests(tests)
Expand Down
18 changes: 18 additions & 0 deletions catkin-env-hooks/20.or_fcl.sh.in
@@ -0,0 +1,18 @@
#!/bin/sh

# determine if we're in the devel or install space
if [ "@DEVELSPACE@" = "True" -o "@DEVELSPACE@" = "true" ]
then
PLUGINS=@CATKIN_DEVEL_PREFIX@/lib/openrave-@OpenRAVE_LIBRARY_SUFFIX@
else
PLUGINS=@CMAKE_INSTALL_PREFIX@/lib/openrave-@OpenRAVE_LIBRARY_SUFFIX@
fi

# append to paths (if not already there)
# from http://unix.stackexchange.com/a/124447
case ":${OPENRAVE_PLUGINS:=$PLUGINS}:" in
*:$PLUGINS:*) ;;
*) OPENRAVE_PLUGINS="$OPENRAVE_PLUGINS:$PLUGINS" ;;
esac

export OPENRAVE_PLUGINS
1 change: 0 additions & 1 deletion package.xml
Expand Up @@ -12,6 +12,5 @@
<depend>boost</depend>
<depend>fcl</depend>
<depend>openrave</depend>
<depend>openrave_catkin</depend>
<test_depend>python-nose</test_depend>
</package>

0 comments on commit c4bf2e5

Please sign in to comment.