Modules: Remove paths already set as global paths
Many modules have legacy hardcoded paths including /usr
or /usr/local
or
specific subpaths thereof. This patch removes the paths already given in
UnixPaths.cmake
and replaces other occurences by PATH_SUFFIXES
approaches.
Not only does this cause the modules to search pathes in a consistent
fashion, but it also enables us to not use a different directory in
the place of /usr/local
. On BSD platforms, such as OpenBSD or FreeBSD,
it is necessary to search $LOCALBASE
instead of /usr/local
- and by
using PATH_SUFFIXES
, we can ensure that by replacing /usr/local
in
CMAKE_SYSTEM_PREFIX_PATHS
the directory given as $LOCALBASE
is being
searched as if it were /usr/local
.
Issue: #17492
Edited by Christian Pfeiffer