CMP0192¶
在 4.1 版被加入.
GNUInstallDirs
uses absolute SYSCONFDIR
, LOCALSTATEDIR
,
and RUNSTATEDIR
in special prefixes.
The GNUInstallDirs
module documents
special cases
for SYSCONFDIR
, LOCALSTATEDIR
, and RUNSTATEDIR
.
When CMAKE_INSTALL_PREFIX
is a special prefix, e.g., /usr
,
the absolute paths for these directories may be outside the prefix, e.g.,
/etc
, /var
, and /var/run
.
In CMake 4.0 and below, the default values for the CMAKE_INSTALL_<dir>
variables, for <dir>
equal to SYSCONFDIR
, LOCALSTATEDIR
, and
RUNSTATEDIR
, always used relative paths (etc
, var
, var/run
),
and the special cases were implemented only when computing absolute paths
for the CMAKE_INSTALL_FULL_<dir>
variables.
CMake 4.1 and above prefer to default CMAKE_INSTALL_<dir>
variables to
absolute paths, for <dir>
equal to SYSCONFDIR
, LOCALSTATEDIR
,
and RUNSTATEDIR
, when CMAKE_INSTALL_PREFIX
is a special
prefix. This policy provides compatibility for projects that have not
been updated to expect this behavior.
The OLD
behavior for this policy is to default CMAKE_INSTALL_<dir>
variables to relative paths. The NEW
behavior for this policy is to
default CMAKE_INSTALL_<dir>
variables to absolute paths, for <dir>
equal to SYSCONFDIR
, LOCALSTATEDIR
, and RUNSTATEDIR
, when
CMAKE_INSTALL_PREFIX
is a special prefix.
This policy takes effect at the first call of include(GNUInstallDirs)
.
Subsequent calls of include(GNUInstallDirs)
reuse cached
CMAKE_INSTALL_<dir>
values from the first call.
This policy was introduced in CMake version 4.1.
It may be set by cmake_policy()
or cmake_minimum_required()
.
If it is not set, CMake does not warn, and uses OLD
behavior.
備註
The OLD
behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.