Provide alternatives to using macro/function to replace standard commands
macro()
and function()
have an undocumented capability to override a builtin CMake command with a macro or function that calls the original through a name prefixed with _
. This was originally added for debugging, accidentally left in, and never documented. There are a few problems with the implementation, such as #14357 (closed) and #14961. See also @craig.scott's Do Not Redefine CMake Commands blog post for why it should not be used.
Some projects have discovered this undocumented functionality and are abusing it for various reasons. We should identify common patterns and add alternative ways to support their use cases.