[cmake-developers] Module macros/function names with single leading underscore

Brad King brad.king at kitware.com
Tue Aug 1 16:42:24 EDT 2017


On 07/23/2017 10:20 AM, Craig Scott wrote:
> maybe it's worth considering renaming these single underscore
> internal macros and functions?

Projects that rely on the undocumented feature depend on being
able to call the original function by prepending the single
underscore.  We can't change the renaming convention without
breaking them.  Even a policy for this may be tricky due to
function definitions being visible globally and therefore
skipping across policy scopes.

The infinite recursion case you mentioned has long been known
and may have a few issue tracker entries.  We haven't really
dealt with it because the feature is undocumented and meant
for debugging.  If anyone can come up with a compatible fix
(e.g. explicit diagnostic) that would be great.

Side note: One day I'd like to see a policy that changes
function/macro definition scopes to be directory-based.
I haven't thought about the correctness or side-effects of
that in detail though.

-Brad


More information about the cmake-developers mailing list