On Mar 14, 2021, at 19:58, Steven Smith wrote:
> I need to run some post-configure steps in a cmake Portfile.
>
> I’m running into two these issues:
>
> Issue 1:
>
> cmake already has some post-configure code. How do I add stuff to whatever
> cmake already has? Not post-configure-append, I see. Not
> {*}${post-configure}. I don’t know enough of the guts of MacPorts tcl to know
> which approach should be used.
>
> Issue 2:
>
> If I change post-configure in an `if` block, the change doesn’t hold. Why
> doesn’t this work?
>
> post-configure {
> awesome_tcl_proc
> }
>
> if {${name} eq ${subport}} {
> # don’t run awesome tcl proc
> post-configure {}
> }
The answer to both questions is the same: pre- and post- blocks are cumulative.
All pre- and post- blocks will run in the order in which they were declared.
There is no way to remove a pre- or post- block once it has been added, so only
add it if you definitely want it.