build: specify POST_BUILD when using add_custom_command

This is needed specifically for the second signature of
add_custom_command, which appends an operation to an existing target.
This will prevent the cmake warning CMP0175.

Reference: https://cmake.org/cmake/help/latest/policy/CMP0175.html
This commit is contained in:
dundargoc
2024-11-08 17:16:43 +01:00
committed by dundargoc
parent 4b001f297a
commit 07b14c8e2e
2 changed files with 6 additions and 1 deletions

View File

@ -61,6 +61,7 @@ function(add_glob_target)
if(NOT ARG_COMMAND)
add_custom_target(${ARG_TARGET})
add_custom_command(TARGET ${ARG_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET} SKIP: ${ARG_COMMAND} not found")
return()
endif()