find_package: optionally resolve symlinks when discovering packages

Teach find_package() to resolve symlinks when constructing
relocatable prefix paths from discovered cmake config files.
The `CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS` variable enables
this behavior when set to `TRUE`.

Fixes: #18704
This commit is contained in:
David Aguilar
2018-12-20 16:41:04 -08:00
committed by Brad King
parent c59eae7ebc
commit a5e948a36f
6 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
-----------------------------------
Set to ``TRUE`` to tell :command:`find_package` calls to resolve symbolic
links in the value of ``<PackageName>_DIR``.
This is helpful in use cases where the package search path points at a
proxy directory in which symlinks to the real package locations appear.
This is not enabled by default because there are also common use cases
in which the symlinks should be preserved.