On 1/21/2013 4:49 PM, Alexander Neundorf wrote:
> It makes cmake warn if /lib64/ is a symbolic link to /usr/lib/ and a
> Config.cmake file has been found in one of both (since any relative directory
> references may be wrong then), see the "General Config.cmake file issue on
> ArchLinux" thread here from November.
A package configuration file can know the path in which it was
installed under the prefix rather than just the number of path
components below the prefix. Rather than using "../.." or
stripping path components to get back the original prefix,
we can actually *compare* the suffix part.
Say we install FooConfig.cmake to "<prefix>/lib/cmake/foo".
The file can check if ${CMAKE_CURRENT_LIST_FILE} sits in a
path ending in "/lib/cmake/foo". If so, then the part before
that is the <prefix>. If not, then we likely have a symlink.
Try resolving symlinks and then checking whether the path
now ends in "/lib/cmake/foo". If so, we now have a <prefix>.
If not, then someone has fiddled with the layout since the
installation.
-Brad
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers