Determine path of (sourced) catkin workspace?
After sourcing a Catkin workspace, what is the best way to determine the root path of the sourced workspace? I'm aware of catkin locate
, however this doesn't have the desired behavior because it does not rely on the sourced workspace, but rather is working directory dependent, i.e.,
- it would not work from outside of the workspace path structure,
- and it does not work if you source workspace A but cd into workspace B etc.
How can I reliably determine the path of the workspace that has been sourced?
Ideally I'm looking a solution that doesn't require further processing like parsing $CMAKE_PREFIX_PATH
, because I need access to the path in several places (scripts) and I'd like to avoid repeating the post processing logic in every place.