[CMake] Running CPack and ignore exit codes

David Cole dlrdave at aol.com
Wed Feb 6 13:58:55 EST 2013


CPack does call "make install" -- and make install first does a make all to get everything up to date.....

So even calling just cpack by itself in this situation is no good.

 

 

 

-----Original Message-----
From: Eric Noulard <eric.noulard at gmail.com>
To: NoRulez <norulez at me.com>
Cc: CMake ML <cmake at cmake.org>
Sent: Wed, Feb 6, 2013 1:57 pm
Subject: Re: [CMake] Running CPack and ignore exit codes


2013/2/6 NoRulez <norulez at me.com>:
> Because CPack runs the default (all) target.

Ok now I think I get it.

AIFAIK, CPack does NOT run "all" target.

"make package" does.

You should be able to call CPack explicitely without problem, try:

cpack

in your build dir. However this won't try to build anything.

> It could be that a target doesn't build because of compile or link errors and 
are not an install target (unit tests for example or other sub projects which 
are not required).

You'll build a package with a failing unit test !! :-]

> CPack should build as much as possible and only break if an install target has 
errors.

Like I said, CPack does not build anything per se, the "package"
target depends on "all"
so that the build tool (make,  Visual Studio, XCode etc...) does build all.

> Currently it is not possible to run cpack and create packages for such 
situation.

True but I'm not sure I would personnally want to build a package out
of a partially buildable project.
Other may have other opinion though.



More information about the CMake mailing list