PATH:GET_ROOT_NAMEΒΆ

Added in version 3.24.

This generator expression belongs to the Path Expressions family. See that section for related generator expressions.

$<PATH:GET_ROOT_NAME,path...>

Returns the root name of path. A root name identifies the filesystem root on filesystems with multiple roots, such as C: or //myserver. If the path has no root name, an empty string is returned.

Changed in version 3.27: CMake now accepts a list of paths as argument. When a list of paths is specified, the operation will be applied to each path.

If a requested component is not present in the path, an empty string is returned.