Fixing installation of bash script
Playing with catkin_lint, I found out about this mistake:
$ catkin lint -W2 --pkg my_pkg
my_pkg: warning: file 'scripts/foo.sh' is executable but not installed
but in my CMakelists I have:
install(DIRECTORY scripts/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} # with or without a "/scripts" here the result doesn't change
PATTERN ".svn" EXCLUDE
)
and have also tried with:
install(FILES
scripts/foo.sh
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} # with or without a "/scripts" here the result doesn't change
)
All these methods still leave the warning on the catkin lint side!
In all four cases I get a correct installation of the script in the install directory, but I have to manually chmod +x
it. The output from rosrun is:
$ rosrun my_pkg foo.sh
[rosrun] Couldn't find executable named foo.sh below /home/<user>/catkin_ws/install/share/my_pkg
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun] /home/<user>/catkin_ws/install/share/my_pkg/foo.sh # or ...my_pkg/scripts/foo.sh
This could just be a limitation ofcatkin_lint
. Perhaps posting an issue on the tracker would be in order.Or, it could be because for shell scripts, the type should be set to
PROGRAMS
, notFILES
orDIRECTORY
.I was being wary of opening another issue for nothing like last time, and for a good reason it seems. Again, thanks!