[MacPorts] #33259: cmake portgroup: out of source build option, possibly by default

MacPorts noreply at macports.org
Tue Mar 10 12:37:04 PDT 2015


#33259: cmake portgroup: out of source build option, possibly by default
---------------------------+--------------------------------
  Reporter:  ryandesign@…  |      Owner:  macports-tickets@…
      Type:  enhancement   |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:
Resolution:                |   Keywords:
      Port:                |
---------------------------+--------------------------------

Comment (by mojca@…):

 Replying to [comment:11 rjvbertin@…]:
 > The point with that is: how are you going handle all different build
 systems?

 I'm not yet sure about all cases.

 It's not a big problem for `./configure`. Setting the `configure.dir` and
 `build.dir` (as well as making one) should be the same. Of course one then
 needs to call `../<name>/configure` instead of just `./configure`. On the
 other hand `autotools` would probably have to be run in the same folder as
 the sources.

 Of course that wouldn't cover all the cases and even cases with
 `configure` might fail for many packages simply because they are not
 properly written and don't support out-of-source builds properly. But
 leaving maintainers the option to opt in could be useful in some cases.

 > CMake has a portgroup exactly because it doesn't work the same as the
 legacy `configure` approach, ditto for qmake and the Python group. So even
 if base could support OOT builds for the systems it supports, the cmake
 (etc) portgroup files will still need to redefine the appropriate values.

 Yes, sure. But we could have a conditional setting. If `Portfile` opts out
 of default behaviour, the PortGroup should not redefine the values for an
 out-of-source build.

 > You wanted a patch? Copying one inline:
 >
 > {{{
 > diff --git a/trunk/dports/_resources/port1.0/group/cmake-1.0.tcl
 b/trunk/dports/_resources/port1.0/group/cmake-1.0.tcl
 > --- a/trunk/dports/_resources/port1.0/group/cmake-1.0.tcl
 (revision 133751)
 > +++ b/trunk/dports/_resources/port1.0/group/cmake-1.0.tcl       (working
 copy)
 > @@ -134,3 +134,13 @@
 >  if {[string first "--enable-debug" ${configure.args}] > -1} {
 >      configure.args-delete     --enable-debug
 >  }
 > +
 > +# setup all ports using cmake to build in a separate directory from the
 source;
 > +# this setting must be the full directory path
 > +post-extract            { file mkdir ${workpath}/build }
 > +
 > +# standard post-arg, where to find the primary CMakeLists.txt file.
 > +default configure.post_args {../${worksrcdir}}
 > +default configure.dir       {${workpath}/build}
 > +default build.dir           {${workpath}/build}
 > +
 > }}}

 It would probably help if we had some (very) basic configurability to opt
 out.

-- 
Ticket URL: <https://trac.macports.org/ticket/33259#comment:12>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list