[CMake] Why CPack does not _ALWAYS_ use DESTDIR?

Alexander Neundorf a.neundorf-work at gmx.net
Tue May 13 12:52:17 EDT 2008


On Tuesday 13 May 2008, Bill Hoffman wrote:
> Eric Noulard wrote:
...
> > Using absolute path install on unix is not a good idea either but
> > you sometimes have to use it to put you file in /etc/ .
> >
> > Be sure I'm not willing to break some backward compatibilty but
> > to avoid strange behavior when building installer.
>
> There is one more issue.  CPack is supposed to work with any build
> system not just CMake.   

Is this an important feature ? I mean, cpack is not really wide spread yet, 
and I think it mostly has advantages if it's integrated with the rest of the 
build done by cmake. At least requiring working DESTDIR support would be 
acceptable IMO (I don't think compatibilty requirements for cpack are already 
as strong as for cmake, since I guess much less people are already using it. 
IMO cpack is just about to become mature.).

> It might just be a set of hand crafted
> makefiles, and it may or may not support DESTDIR.   I suppose this could
> be taken care of by only making DESTDIR the default if it is a CMake
> based project.   However, people can inject code into the install rules
> for a cmake project that may not honor DESTDIR.  You can write any cmake
> script you want into the install files.   

In KDE any install() rule which doesn't honor DESTDIR is considered a bug. I 
think basically all linux packagers (not the generators in cpack, but the 
persons creating packages) rely on DESTDIR being supported properly. So I 
would almost dare to say that any install() rules which don't honor DESTDIR 
are broken. (time for a cpack policy ? ;-) )

> I am almost certain someone's
> code will break if we change this.  However, I can not point to it, and
> I am guessing the projects depending on it won't even know that they are
> depending on it, until we break it for them.  Adding an extra set is not
> such a big deal.

I actually found Erics argument that the default behaviour is not working for 
absolute install dirs with any package generator quite good.

The rpm and deb generators are new, would it be ok to enable DESTDIR for these 
two unconditionally ? There can be nobody who relies on this behaviour for 
these two package types yet.

Alex


More information about the CMake mailing list