[CMake] cpack, deb file & static libraries

Eric Noulard eric.noulard at gmail.com
Sat Nov 20 13:08:34 EST 2010


2010/11/20 Paolo Zaffino <p.zaffino at yahoo.it>:
> I try to explain better:
> When I compile my source code, for building the foo executable is needed the
> library bar.a
> Both the files are building during the compile process...into the deb
> package I want include foo but I don't want include bar.a

Building and packaging are separate steps,
usual steps with CMake are:

1) CMake time: this is when cmake runs for configuring the source
2) Build time   : this is when the build tool (make, visual studio,
Xcode, ...) is invoked in order to build,
                       i.e. compile the source.
3) Install time  : this is when you install the compiled project
4) CPack time : this is when CPack runs
5) Package install time : this is when the package built with CPack
(RPM, Deb, NSIS, ...)  is running/installed.

Those steps may be calling each other when needed.
E.g. step 2) is calling step 1) whenever a CMakeLists.txt changed.
       step 3) may call step 2) if the installed target are not up-to-date.

CPack when invoked will trigger step 3) using specific destination arguments,
then the package is built.

So there is no such thing as:

"Both the files are building during the compile process...into the deb"

"compile process" is step 2)
Whereas "into the deb" is step 4).

What both Rolf and me said to you is that step 3) is driven by
the INSTALL rules. You should be using an INSTALL rule
for the executable and NOT for the library.

Please show us your CMakeLists.txt it will be easier to help you.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list