catkin / catkin_tools

Command line tools for working with catkin
Apache License 2.0
163 stars 146 forks source link

remove leading and trailing ':' in CMAKE_PREFIX_PATH #729

Closed lucasw closed 1 year ago

lucasw commented 2 years ago

I had some CMAKE_PREFIX_PATH modifications like the following that resulted in leading :

export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/my/path/...

and the result is that :: gets baked into the CMAKE_PREFIX_PATH later, but then a mismatch occurs:

WARNING: Your current environment's CMAKE_PREFIX_PATH is different from the cached CMAKE_PREFIX_PATH used the last
time this workspace was built.

If you want to use a different CMAKE_PREFIX_PATH you should call `catkin clean` to remove all references to the previous
CMAKE_PREFIX_PATH.

Cached CMAKE_PREFIX_PATH:
    /home/lucasw/base_catkin_ws/devel:/home/lucasw/other/install:/home/lucasw/other/install/lib/cmake
Current CMAKE_PREFIX_PATH:
    /home/lucasw/base_catkin_ws/devel::/home/lucasw/other/install:/home/lucasw/other/install/lib/cmake

so added strip(':') everywhere CMAKE_PREFIX_PATH is loaded from the environment