[CMake] change where package is generated; full name of package with extension

Tyler Roscoe tyler at cryptio.net
Fri Jun 18 13:12:08 EDT 2010


On Fri, Jun 18, 2010 at 01:06:46PM -0400, David Cole wrote:
> On Fri, Jun 18, 2010 at 1:01 PM, Tyler Roscoe <tyler at cryptio.net> wrote:
> > On Fri, Jun 18, 2010 at 06:30:25PM +0200, Eric Noulard wrote:
> > > 2010/6/18 Tyler Roscoe <tyler at cryptio.net>:
> > > > 1. I want to change where "make package" deposits the packages it
> > > > creates.  Is there a way to do this -- some cpack variable I haven't
> > > > found?
> > >
> > > No variable I am aware of.
> > > However you may create a custom target which call make package and then
> > > move the file, provided you know the name of the generated file ....
> >
> > The frustrating part here is that I can't add_dependencies or post-build
> > custom_commands to the PACKAGE target because it is a "magic" CMake
> > target. I suppose I can look into writing a custom_command that runs
> > cpack with appropriate arguments, but I hoped to avoid this step.
> 
> But you could make a "build-products-done" custom target, and then use
> add_dependencies with that and all the other "real" CMake targets that you
> have to make it go last after all the real stuff is built.
>
> Then you can add another custom target to do as much 'make package' type
> stuff as you want and make it depend on the "build-products-done" custom
> target...

I also need "make install" and "make package" to run. How can I force my
build-products-done target to depend on installation and packaging? Or
am I misunderstanding you?

> Because to do what you want, you want multiple make package steps anyhow,
> right?

I don't think I need this. I only need "make package" to run once; then
I can simply consume the results of packaging -- the
myproject.[tar.gz|.zip|.exe] files.

Thanks David,
tyler


More information about the CMake mailing list