Comment #1 on issue 610 by jz...@
google.com: Hard coded WebP_INCLUDE_DIRS after install makes installation un-relocatable
https://bugs.chromium.org/p/webp/issues/detail?id=610#c1This likely came from the simple example for configure_package_config_file() [1].
Looking at a few cmake files from packages I have installed on Debian I see a few like this and others with some variation of:
```
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Use original install prefix when loaded through a
# cross-prefix symbolic link such as /lib -> /usr/lib.
get_filename_component(_realCurr "${_IMPORT_PREFIX}" REALPATH)
get_filename_component(_realOrig "/usr/lib/x86_64-linux-gnu/cmake/zstd" REALPATH)
if(_realCurr STREQUAL _realOrig)
set(_IMPORT_PREFIX "/usr/lib/x86_64-linux-gnu/cmake/zstd")
endif()
unset(_realOrig)
unset(_realCurr)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
```
Another simply has:
```
get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../../.." ABSOLUTE)
```
[1]
https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#command:configure_package_config_file