[CMake] Why CPack does not _ALWAYS_ use DESTDIR?

Eric Noulard eric.noulard at gmail.com
Tue May 13 08:04:26 EDT 2008


2008/5/13, David Cole <david.cole at kitware.com>:
> On Windows, where you have DESTDIR=C:/MyDir and an "absolute" install path
> of "C:/Program Files/Whatever"....
>
> "C:/MyDir/C:/Program Files/Whatever" is probably going to make somebody a
> bit grumpy...

Ok right, I see, DESTDIR and ABSOLUTE path should be mergeable
which is the case on Unix and not on Windows, because of those nasty
letter drive thing.

I may propose to default use of DESTDIR

_For CPack generator_
AND
_For UNIX platform only_

but keep reading it may be worth a look on WIN32 too.

Currently people cannot use _ANY_ CPack generator on Unix platform
if their project use absolute path install unless they
SET(CPACK_SET_DESTDIR "ON") in the CMakeList.txt

I think it wasn't a user-friendly behavior.

> Big picture perspective needed. Do not hastily change default behaviors.

Be sure I'm really concerned with not changing default behavior
and thus not to break "backward compatibility".

However I find the default behavior to be more than buggy.

In fact if ever you are root when doing "make package" on Unix
(which is NOT a good idea I admit)
not only you are building a package but your are
installing the absolute installed file for good :=)

As you should have guessed I'm not a Windows man but in order
to be sure I've just tested the preceding scheme on a Windows box
nearby and guess what, when you build NSIS or ZIP installer using
CPack (2.6.0) not only the absolute path installed file are not included in
the NSIS installer/zip but the file are installed for good when you are building
the installer.

You may try the attached project on a windows box, in order to make sure
I did not do something wrong.

In fact I think (or I hope) no-one is using absolute path install
on windows precisely because the "letter drive" may make your installer
just buggy.

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.


-- 
Erk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myscript-1.0-src.tar.gz
Type: application/x-gzip
Size: 727 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080513/1b1e4784/attachment.bin>


More information about the CMake mailing list