How to set the cached CMAKE_PREFIX_PATH as current

asked 2016-11-03 11:22:59 -0500

Shadow0144 gravatar image

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.

edit retag flag offensive close merge delete



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.

ahendrix gravatar image ahendrix  ( 2016-11-03 11:33:55 -0500 )edit

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.

Shadow0144 gravatar image Shadow0144  ( 2016-11-04 02:56:04 -0500 )edit

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.

ahendrix gravatar image ahendrix  ( 2016-11-04 11:40:08 -0500 )edit

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?

Shadow0144 gravatar image Shadow0144  ( 2016-11-09 07:11:06 -0500 )edit

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.

ahendrix gravatar image ahendrix  ( 2016-11-09 13:31:24 -0500 )edit

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.

ahendrix gravatar image ahendrix  ( 2016-11-09 13:32:13 -0500 )edit

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!

Shadow0144 gravatar image Shadow0144  ( 2016-11-18 08:42:28 -0500 )edit