[CMake] cmake deletes cache when source patch contains symlink to complier directory

Brad King brad.king at kitware.com
Mon Nov 30 09:43:44 EST 2009


Hi Russell,

Thanks for tracking this down to such a specific set of conditions.
If you hadn't done that work up front it might have taken a while to
find this.

Russell Yanofsky wrote:
> I think a safe and straightforward fix would be to make cmake use
> SystemTools::CollapseFullPath for the path it writes to
> CMakeFiles/CMakeCCompiler.cmake, but I didn't see an obvious way of
> implementing this, because the file is generated by CMake code, and not
> C++ code. I wonder if it makes sense to expose the CollapseFullPath
> function to CMake scripts so CMake code can use it.

It's available through get_filename_component(), using the ABSOLUTE or
REALPATH modes.  Please try adding that to the determine-compiler code
to see if it fixes your problem.

Thanks,
-Brad


More information about the CMake mailing list