CMP0004

警告

該方針的 OLD 行為已在 CMake 版本 4.0 中移除。該方針必須透過呼叫 cmake_minimum_required()cmake_policy() 設定為 NEW

Libraries linked may not have leading or trailing whitespace.

CMake versions 2.4 and below silently removed leading and trailing whitespace from libraries linked with code like

target_link_libraries(myexe " A ")

This could lead to subtle errors in user projects.

The OLD behavior for this policy is to silently remove leading and trailing whitespace. The NEW behavior for this policy is to diagnose the existence of such whitespace as an error. The setting for this policy used when checking the library names is that in effect when the target is created by an add_executable() or add_library() command.

This policy was introduced in CMake version 2.6.0. Prior to removal in CMake version 4.0, it could be set by cmake_policy() or cmake_minimum_required(). If it was not set, CMake warned, and used OLD behavior.