> On Nov 5, 2016, at 4:30 PM, René J.V. Bertin <[email protected]> wrote:
> 
> Hi,
> 
> My cmake 1.1 PortGroup has been committed very recently, and we're still 
> readying a new version of port:QtCurve as a first real-life test of some of 
> its new features.
> 
> I just realised we missed a feature that could have been implemented too: 
> control over CMake's generator.
> 
> In short:
> 
> - CMake can generate ninja build files. This is supposedly (much) faster, 
> even for one-time builds
> - When using the standard (Unix Makefiles) generator, destroot.target could 
> be set to "install/fast" which only installs the build result but doesn't 
> verify if anything has to be rebuilt. This too can give a significant 
> speed-up for large, complex projects. This could (should) be the default for 
> destroot.target since we should be able to assume safely that the destroot 
> phase is entered only after a successful build.
> 
> Reason I'm posting here is that I'm not sure how best to implement this. What 
> I have in mind if a procedure that is called with the generator name, and that
> 
> - when called with "ninja", adds a build dependency on port:ninja and 
> (re)sets "default destroot.target install"
> - when called with "Unix Makefiles", removes port:ninja from the build 
> dependencies and (re)sets "default destroot.target install/fast".
> - raises an error when called with anything else until someone finds a reason 
> to implement support for other build generators.
> 
> I have a hunch there might be a more elegant way to do this, but I'm not 
> enough of a Tcl expert and intimate with the base layer to know how.

Instead of a procedure that the portfile calls directly, you would probably 
want to use an "option" (a variable with extra features) and an "option_proc" 
(a procedure that gets called automatically when an option's value is changed).

The php.branches option in the php 1.1 portgroup, the python.versions option in 
the python 1.0 portgroup, and the github.tarball_from option in the github 1.0 
portgroup are examples of this functionality.

Reply via email to