environment hook doesn't get triggered with catkin config --install
To update some environment variable, I created a script call 10.init.bash.em
with
#!/bin/bash
export ENV_VAR="....
and added catkin_add_env_hooks(10.init SHELLS bash)
in CMakeLists.txt
When I have catkin config --no-install
, it seems to update the variable fine.
However, when I have catkin config --install
, the environment was not updated even though the file is added to devel/etc/catkin/profile.d/
after build
I do source <ws>/devel/setup.bash
explicitly to make sure setup is triggered correctly.
Can anyone guide me on how to setup my project right with the event hook?
One question I have aside is whether devel/setup/sh
is supposed to be triggered after build or not
should you not be
source
ingsetup.bash
instead if you're using Bash?ya, I mean, I have tried running the script
Unless I'm misunderstanding you, you shouldn't execute
setup.sh
orsetup.bash
.You always
source
them.I have tried source it, execute it. the point is I have tried my best to get it setup but does not work. I am trying to add couple more paths to
LD_LIBRARY_PATH
. I have noticed that it gets updated when I source but it doesn't add what I have in env hook which indicates that environment is getting ready but not triggering the hookthe only correct way to use that file would be to
source
it. Any other use is not expected to work.this is actually not a good idea I believe, and if it is needed, seems to point to some other problem with your code/nodes.
Ignoring that, it could be there is some difference in how env hooks are managed between
devel
andinstall
spaces, but I'm not aware of any.Perhaps @Dirk Thomas does.