Skip to content

Commit

Permalink
env-hooks: install env-hook for ocl-lua to etc/orocos/OROCOS_TARGET/p…
Browse files Browse the repository at this point in the history
…rofile.d

The env-hook adds the installation folders of the ocl-lua modules to the LUA_PATH/LUA_CPATH environment
variable.

The scripts in etc/orocos/OROCOS_TARGET/profile.de will be sourced in lexical order by a new setup.sh
script located in the orocos_toolchain repository.

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>
  • Loading branch information
meyerj committed Nov 11, 2016
1 parent f971a15 commit 6a8bcef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,14 @@ ENDIF( DISPLAY_FLAGS )

INSTALL(FILES package.xml DESTINATION share/ocl)

# Install an env-hook if catkin is found
# Install an env-hook
configure_file(env-hooks/00.ocl-lua.sh.in ${CMAKE_CURRENT_BINARY_DIR}/env-hooks/00.ocl-lua.sh @ONLY)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/env-hooks/00.ocl-lua.sh
DESTINATION etc/orocos/${OROCOS_TARGET}/profile.d
)

# Install a catkin env-hook if catkin is installed
find_package(catkin QUIET)
if(catkin_FOUND)
catkin_add_env_hooks(00.ocl-lua SHELLS sh DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)
Expand Down
17 changes: 10 additions & 7 deletions env-hooks/00.ocl-lua.sh.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/sh

if [ "x$LUA_PATH" = "x" ]; then
LUA_PATH=";"
if [ -d "@CMAKE_INSTALL_PREFIX@/share/lua/5.1" ]; then
if [ "x$LUA_PATH" = "x" ]; then
LUA_PATH=";"
fi
export LUA_PATH="$LUA_PATH;@CMAKE_INSTALL_PREFIX@/share/lua/5.1/?.lua"
fi
export LUA_PATH="$LUA_PATH;@CMAKE_INSTALL_PREFIX@/share/lua/5.1/?.lua"

if [ "x$LUA_CPATH" = "x" ]; then
LUA_CPATH=";"
if [ -d "@CMAKE_INSTALL_PREFIX@/lib/lua/5.1" ]; then
if [ "x$LUA_CPATH" = "x" ]; then
LUA_CPATH=";"
fi
export LUA_CPATH="$LUA_CPATH;@CMAKE_INSTALL_PREFIX@/lib/lua/5.1/?.so"
fi
export LUA_CPATH="$LUA_CPATH;@CMAKE_INSTALL_PREFIX@/lib/lua/5.1/?.so"

0 comments on commit 6a8bcef

Please sign in to comment.