CMP0223ΒΆ

Added in version 4.5.

An empty path is not a prefix of any path.

cmake_path(IS_PREFIX) and the $<PATH:IS_PREFIX> generator expression treat an empty path as a prefix of every path, including another empty path. A prefix that is empty because a variable was set to an empty value, or because a generator expression argument expanded to nothing, therefore satisfies a check that was meant to reject it.

The if() command's PATH_IS_PREFIX operator is new in the same release and has no previous behavior of its own, but it follows this policy so that it agrees with cmake_path(IS_PREFIX) in every policy state.

The OLD behavior for this policy is to treat an empty path as a prefix of every path. The NEW behavior is to treat an empty path as a prefix of no path.

This policy was introduced in CMake version 4.5. It may be set by cmake_policy() or cmake_minimum_required(). If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is deprecated by definition and may be removed in a future version of CMake.