[cmake-developers] Function overrides

Brad King brad.king at kitware.com
Thu May 30 11:39:01 EDT 2013


On 05/30/2013 11:14 AM, Wojciech Knapik wrote:
> The problem is, that you can't redefine, say, add_executable more than
> once, as discussed here:
> http://www.cmake.org/pipermail/cmake/2011-March/043320.html

The command-override feature is meant for local debugging only.

Allowing "recursive" overrides is ill-defined because of the
way functions are (not) scoped when the same module is included
in multiple disjoint directories.

> PS. I know you can achieve this by providing a wrapper for the user to
> use instead of the standard function, but that's not nearly as nice, is
> it ?

As someone reading code I like knowing that a command does
what the CMake documentation says it does and nothing more.

-Brad



More information about the cmake-developers mailing list