Skip to content

cmakepp custom return() command gives warnings in some cases #127

@Manu343726

Description

@Manu343726

Hi Tobias,

I'm having some issues related to the way you handled #3: Your return() command overrides the default CMake one so if you do a naked return() invocation in a module for example (As many CMake built-in modules do) you end up with warnings about the module not having a parent scope.

I would consider using a CACHE variable for __ans instead. I know this is not as performant as PARENT_SCOPE, but most scripts using cmakepp have already a noticeable slowdown by the temporary file creation for dynamic function invocation and the like. I don't specially care about performance when using cmakepp, I care about expressiveness and the huge amount of extra tools I have. So picking UX in favor of performance would be fine for me. What do you think?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions