[CMake] CPack for 2.6: How to control what gets packed?

Eric Noulard eric.noulard at gmail.com
Tue Dec 20 03:11:38 EST 2011


2011/12/19 Harelick, Matthew <MHarelick at ise.com>:
> Hi:
> I am using the install command to create a file organization that looks
> something like this:
>
> Myapp:
>                 bin
>                 examples
>                 lib
>                 config
>
> For the lib directory I am naming specific libraries when I perform the
> install, like this:
>                                 "${XMLLIB}/libxerces-c.so.28"
>                                 "${XMLLIB}/libxerces-c.so.28.0"
>
> The install step works fine.

The subject says you are using CPack 2.6, any particular reason you do
not use 2.8.x?
2.6 is becoming ancient.

> The problem is that when I call cpack with
>
> CPack, I am expecting CPack to just package up my install directory.
> However its not doing that because its leaving the libxerces-c.so.28
> library.  How do I get CPack to just package up the install directory
> created in previous steps?

It does not really work that way.
When you call CPack, it calls the install procedure with a private DESTDIR
located in the build tree (<buildroot>/_CPack_Packages/...).

This has to be like that because it's the only way for CPack to be sure to
package what is effectively installed by you project and not some left-over
which appear to be there at the install location.

That said we lack informations in order to be able to help you:
1) Which system are you using (Windows, Linux, etc...)

2) Which CPack generator are you using (ZIP, NSIS, RPM, ....)

3) You should show us the exact install commands you use
    (and not the mere names of the installed files)
    I suspect you use absolute path install for your libraries.
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list