[CMake] Odd Happening

Brad King brad.king at kitware.com
Wed Jun 22 09:51:50 EDT 2005


mansoa at rpi.edu wrote:
> I have a strange thing happening,  cmake always makes its paths the same
> ones.  Let me give you and example I have two build trees, one rooted at
> c:\buildtree and another rooted at c:\buildtree2\  And both have the same
> cmakelists files in them.  If I run c:\buildtree through cmake it works
> just fine.  But if I then run it on c:\buildtree2 it still puts all the
> paths to includes and libraries and what not as if I ran it on the
> c:\buildtree.  I noticed this after I deleted and old build tree I had been
> using to test the cmake files, and then suddenly my build tree I was using
> stopped working because it could not find files in the other build tree
> which it should not have been looking in anyways.  I looked in all my files
> and I have only relative paths so it could not be that.  Any ideas?  Is
> there some registry entry, file, or something that is storing the full
> paths and for some reason is not being updated?

If there is a CMakeCache.txt file in the path you specify as the source 
then it is treated as a build tree instead and the source path is read 
out of the cache.  This enables you to reconfigure a project by running 
"cmake ." in the build tree.  As a side effect it means that once you 
have an in-source build you cannot have an out-of-source build.  I'm not 
sure this is your problem, but it is something to check.

-Brad


More information about the CMake mailing list