How to set the cached CMAKE_PREFIX_PATH as current
I get the message
WARNING: Your current environment's CMAKE_PREFIX_PATH is different from
the cached CMAKE_PREFIX_PATH used the last time this workspace was built.
whenever I build and then it proceeds to use the wrong path to build. But I cannot figure out how or why it is resetting this variable.
Have you tried cleaning your workspace by removing the build and devel folders, and then building again? The cmake cache is somewhere in the build folder.
Yes, I've done that. But that's the opposite of what I want. That'll set it to the current CMAKE_PREFIX_PATH; I want the old one. I built ROS from source, but catkin continues to try to point itself at some other installation or something.
It sounds like something is setting the CMAKE_PREFIX_PATH in your shell on startup. You should investigate what it's being set to and try to find what is setting it.
I'm new to Linux; I checked the .bashrc, but there's no mention of CMake there. Do you know where else I might want to check?
The ROS setup script sets the CMAKE_PREFIX_PATH ; if you're calling the wrong setup script from you .bashrc, that could be the source of your CMAKE_PREFIX_PATH.
If a ROS setup script is setting the CMAKE_PREFIX_PATH, the contents of the CMAKE_PREFIX_PATH will also give you a hint about which setup script is setting it.
Sorry for the very late reply. It appears to have stopped producing the warning on its own somehow. Maybe something changed somewhere, I'm not sure. But thank you for the help. If I encounter the problem again, I'll know what to do. Thanks!