[CMake] Continue install after a failure

Petr Kmoch petr.kmoch at gmail.com
Tue Oct 23 02:53:35 EDT 2012


On Mon, Oct 22, 2012 at 4:58 PM, David Cole <david.cole at kitware.com> wrote:

> On Mon, Oct 22, 2012 at 3:22 AM, Petr Kmoch <petr.kmoch at gmail.com> wrote:
> > Hi Andreas,
> >
> > thanks for your tip. Unfortunately, 'make -k install' doesn't help, as
> the
> > entire install step is a single command (cmake -P ...), so once this
> fails,
> > there is no other command make could continue with. Is there no way to do
> > this natively in cmake?
> >
> > I could (in theory) add OPTIONAL to all install() commands, but that has
> the
> > problem of being absolutely silent when a file is not found, and I'd
> need at
> > least a message or warning. Is cmake really all-or-nothing in this
> aspect,
> > or does anyone know a feature I'm overlooking?
> >
> > Thanks for any help.
> >
> > Petr
> >
> >
> > On Sat, Oct 20, 2012 at 12:46 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> >>
> >> Hi,
> >>
> >> On Sat, Oct 20, 2012 at 11:39 AM, Petr Kmoch <petr.kmoch at gmail.com>
> wrote:
> >> > when running the install step of a CMake-generated buildsystem (i.e.
> >> > 'make
> >> > install' or building the VS project INSTALL), the run terminates after
> >> > the
> >> > first failure (e.g. when it cannot find a file which is to be
> >> > installed). Is
> >> > there a way to globally change this behaviour so that the error is
> >> > reported
> >> > (perhaps as a warning), but the install step goes on?
> >>
> >> For Makefile Generator you can run make -k install, that way make
> >> keeps on going even when errors occur. No idea about VS, NMake, Ninja
> >> or XCode generators probably depends on wether the respective tool has
> >> a switch for continuing if errors occur.
> >>
> >> Andreas
> >
> >
> >
> > --
> >
> > 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
>
>
> CMake is all-or-nothing with respect to an install tree. If the cmake
> install script hits a "FATAL_ERROR" message then it stops and will not
> continue beyond that point...
>
> The best way to "Continue install after a failure" is to eliminate the
> failure, and try again.
>

Would you accept a patch giving control over this behaviour? Something like
a boolean variable CMAKE_INSTALL_STOP_ON_ERROR (the default being TRUE, of
course).

Petr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121023/95a27e64/attachment-0001.htm>


More information about the CMake mailing list