CMake: Fix Policy CMP0175 warning

CMake 3.31 has begun emitting CMP0175 [1] when you call add_custom_command
with invalid keywords. While `MAIN_DEPENDENCY` is a valid keyword for
`add_custom_command(OUTPUT)` [2] it is not for `add_custom_command(TARGET)` [3]

proper fix is to remove the offending parameters.

[1] https://cmake.org/cmake/help/latest/policy/CMP0175.html
[2] https://cmake.org/cmake/help/latest/command/add_custom_command.html#generating-files
[3] https://cmake.org/cmake/help/latest/command/add_custom_command.html#build-events

Pull Request: https://projects.blender.org/blender/blender/pulls/130565
This commit is contained in:
Ray molenkamp
2024-11-23 01:55:00 +01:00
parent 56ed17b60f
commit 87a7cab146

View File

@@ -633,7 +633,7 @@ if(NOT ("${_install_cmd}" STREQUAL ""))
# Message to display after building.
get_filename_component(_install_dst ${TARGETDIR_VER} ABSOLUTE BASE_DIR ${CMAKE_INSTALL_PREFIX})
add_custom_command(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
TARGET blender POST_BUILD
COMMAND
${CMAKE_COMMAND} -E echo
"Run: \\\"${_install_cmd}\\\" to copy runtime files and scripts to: ${_install_dst}"