[cmake-developers] General Config.cmake file issue on ArchLinux

Stephen Kelly steveire at gmail.com
Tue Dec 4 03:36:16 EST 2012


Alexander Neundorf wrote:

> All install variables which are at cmake time somewhere below
> CMAKE_INSTALL_PREFIX are treated as relative to CMAKE_INSTALL_PREFIX.
> This is what the @PAKCAGE_INIT@ macro together with the @PACKAGE_FOO_DIR@
> variables does.

Could your set_and_check macro be extended to warn in cases where a symlink 
is crossed?

eg:

File /lib64/cmake/foo/FooConfig.cmake
contains set(Foo_Bar_Dir "../../../lib/libfoobar.so")

set and check walks up the path and checks at each step if it is a symlink. 
When it is at lib64/ which is a symlink and there is another '..', emit a 
warning? Similarly when climbing back up the path (eg if lib in the example 
above is a symlink). That should at least warn no matter which way around it 
is, right? 

It's something that would need to be an option to cmsys::CollapseFullPath 
maybe. I'm still just brainstorming here really.

> Well, if you have a symlink, you don't know whether the symlink is the
> correct location or the target of the symlink is the correct destination.
>

If you cross a symlink while processing a relative path, then something must 
have gone wrong. It's at least worth a warning. Or am I missing something?

Thanks,

Steve.





More information about the cmake-developers mailing list