[CMake] cmake-gui's separation between configuration & generation

David Cole david.cole at kitware.com
Thu Aug 23 14:03:25 EDT 2012


On Thu, Aug 23, 2012 at 11:50 AM, Robert Dailey <rcdailey.lists at gmail.com>wrote:

> On Thu, Aug 23, 2012 at 10:48 AM, Robert Dailey
> <rcdailey.lists at gmail.com> wrote:
> > On Thu, Aug 23, 2012 at 10:43 AM, John Drescher <drescherjm at gmail.com>
> wrote:
> >>> Is the separation between configuration & generation really necessary
> >>> for cmake-gui? I ask because several of my co-workers are confused
> >>> between the differences in the two, even though I explain it.
> >>>
> >>> Honestly there isn't really a reason that I can think of to do a
> >>> configure without a generate, unless you're testing the integrity of
> >>> your CMake script changes maybe, but even then, if its broken
> >>> generation won't take place.
> >>>
> >>> The command line program does not separate the two, so I simply think
> >>> cmake-gui should eliminate the configure button, and simply have a
> >>> generate button. Does this seem fair? Is there a reason why they are
> >>> separated?
> >>
> >> I can think of one use case that I use that the separation is a good
> >> thing. What about when you have options and variables that are
> >> conditional depending on other CMake variables so that setting the
> >> variables / options may take more than 1 configure.
> >
> > Well, think of this from the perspective of Linux users. They don't
> > get to configure seperately, so only Windows users get special
> > treatment here (and maybe Mac too, since it's using Qt). Basically, if
> > two configures are necessary, you simply just hit the "generate"
> > button twice, and the wait may be slightly longer because of the
> > generation. However, usually it's the configure step that takes 99% of
> > the time and generation is quick since it's just spitting out files to
> > disk it seems.
> >
> > I would also argue that any CMake project should have appropriate
> > defaults OR logic to calculate the defaults for you, so that even if a
> > user decides to not modify any cache variables, generation should
> > always succeed. CMake can't assume that 2 passes will be necessary
> > (and it really shouldn't).
>
> Oh and also, if two configures are necessary (say that, a library or
> package can't be found intelligently), then the configuration step
> would fail and be interrupted, so you get a chance to correct any
> errors and adjust appropriate cache variables. So, in this case it
> doesn't really matter if you've hit configure or generate.
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


Iterative configuring through the gui is useful for some people/projects,
and generating is time-consuming too on some larger projects with some
generators.

So we probably won't be eliminating the Configure button anytime soon. On
the other hand, you can just click "Generate" if that's what you want and
ignore the configure button altogether nowadays. "Generate" will
configure-first if necessary, and then generate.

Here are some related issues indicating some people want the exact opposite
(i.e., separate configure and generate steps for the command line cmake)
  http://public.kitware.com/Bug/view.php?id=13359

And a request for a "build" button in cmake-gui:
  http://public.kitware.com/Bug/view.php?id=8260


Cheers,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120823/dbc3e6f9/attachment.htm>


More information about the CMake mailing list