CMP0062

警告

此策略的 OLD 行为已在 CMake 4.0 版本中移除。此策略必须通过调用 cmake_minimum_required()cmake_policy() 来设置为 NEW

3.3 版本中新增。

不允许安装 install()export() 的结果。

The export() command generates a file containing Imported Targets, which is suitable for use from the build directory. It is not suitable for installation because it contains absolute paths to buildsystem locations, and is particular to a single build configuration.

The install(EXPORT) generates and installs files which contain Imported Targets. These files are generated with relative paths (unless the user specifies absolute paths), and are designed for multi-configuration use. See Creating Packages for more.

CMake 3.3 不再允许使用 install(FILES) 命令处理 export() 命令的结果。

The OLD behavior for this policy is to allow installing the result of an export() command. The NEW behavior for this policy is not to allow installing the result of an export() command.

此策略引入于 CMake 版本 3.3。在 CMake 版本 4.0 移除之前,可以通过 cmake_policy()cmake_minimum_required() 进行设置。如果未设置,CMake 会发出警告并使用 OLD 行为。