CMP0051

警告

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

在 3.1 版被加入.

List TARGET_OBJECTS in SOURCES target property.

CMake 3.0 and lower did not include the TARGET_OBJECTS generator expression when returning the SOURCES target property.

Configure-time CMake code is not able to handle generator expressions. If using the SOURCES target property at configure time, it may be necessary to first remove generator expressions using the string(GENEX_STRIP) command. Generate-time CMake code such as file(GENERATE) can handle the content without stripping.

The OLD behavior for this policy is to omit TARGET_OBJECTS expressions from the SOURCES target property. The NEW behavior for this policy is to include TARGET_OBJECTS expressions in the output.

此方針於 CMake 版本 3.1 中引入。在 CMake 版本 4.0 移除之前,它可以透過 cmake_policy()cmake_minimum_required() 設定。如果未設定,CMake warned,並使用 OLD 行為。