Skip to content

Commit

Permalink
Merge pull request FlexBE#18 from meyerj/feature/install-rules
Browse files Browse the repository at this point in the history
Add cmake install rules and use rospack to find nw executable
  • Loading branch information
pschillinger authored Jun 30, 2018
2 parents d2f3de7 + 16d0cd4 commit 8d2e0dd
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 6 deletions.
48 changes: 48 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,51 @@ add_custom_target(nw_install DEPENDS nw)
if(NOT ${CMAKE_CURRENT_SOURCE_DIR}/nw)
safe_execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/nwjs_install)
endif()

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

# call catkin_destinations() to populate CATKIN_*_DESTINATION cmake variables
catkin_destinations()

install(DIRECTORY
launch
src
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(PROGRAMS
bin/run_app
bin/shortcut
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY
lib
locales
swiftshader
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS
)

install(FILES
credits.html
flexbe.desktop
icudtl.dat
natives_blob.bin
nw_100_percent.pak
nw_200_percent.pak
package.json
resources.pak
snapshot_blob.bin
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(PROGRAMS
nw
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
6 changes: 3 additions & 3 deletions bin/run_app
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
cd "$( dirname "${BASH_SOURCE[0]}" )"

if [ ! -f ../nw ]; then
NW="$(rospack find flexbe_app)/nw"
if [ ! -x "${NW}" ]; then
echo "Cannot run flexbe_app, need to download nwjs first."
echo "Please build flexbe_app via catkin before using it or run the following command now:"
echo " rosrun flexbe_app nwjs_install"
exit -1
fi

../nw --password-store=basic $*
"$NW" --password-store=basic "$@"
6 changes: 3 additions & 3 deletions bin/shortcut
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
if [ $1 == "create" ] ; then
cd "$( dirname "${BASH_SOURCE[0]}" )"/..
if [ "$1" == "create" ] ; then
cd $(rospack find flexbe_app)
cp flexbe.desktop ~/.local/share/applications
cp src/img/icon-128.png ~/.local/share/icons/flexbe_app.png
echo "Launcher shortcut created"
elif [ $1 == "remove" ] ; then
elif [ "$1" == "remove" ] ; then
rm ~/.local/share/applications/flexbe.desktop
rm ~/.local/share/icons/flexbe_app.png
echo "Launch shortcut removed"
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
<run_depend>rospy</run_depend>
<run_depend>genpy</run_depend>
<run_depend>actionlib</run_depend>
<run_depend>rospack</run_depend>

</package>

0 comments on commit 8d2e0dd

Please sign in to comment.