[CMake] CMake being too clever?

Brad King brad.king at kitware.com
Fri Jul 22 14:31:46 EDT 2005


Amitha Perera wrote:
> On Fri 22 Jul 2005, Brad King wrote:
> 
>>[CMake] has some fancy code to convert to a sensible relative path even
>>in the case of symlinks and nfs mounts.  Native build tools such as
>>make do not have this logic.  We're discussing this internally and
>>will probably end up going back to full paths with this example as
>>ammunition on the FAQ for why we use them.
> 
> 
> That would be bad. The "right" way to do this would be for CMake to
> remember what the user supplied as the way to get from the binary
> tree to the source tree. So:
> 
> cmake ../src     # use relative
> cmake /abc/src   # use "absolute" (not realpath())
> 
> In the latter case, the top-level CMakeLists.txt should be accessed
> as "/abc/src/CMakeLists.txt", regardless of symlinks and mount
> points. This has the advantage of working well with automounts.

The problem is that CMake IS remembering this.  It no longer uses 
realpath.  It is generating the proper relative path taking the symlink 
into account.  Then MAKE is evaluating the relative path with respect to 
the realpath and not the logical path.  There is nothing we can do about 
that :(

-Brad


More information about the CMake mailing list