[cmake-developers] Using CPack to package things not built using CMake

Bruce Stephens bruce.r.stephens at gmail.com
Mon May 23 09:40:34 EDT 2016


Suppose I have a build which uses a number of external projects
(perhaps built using ExternalProject_Add) but which use a variety of
build systems.

And I want to package the result (so I arrange for the external
projects to build expecting themselves to be installed under
/opt/foo).

What are good ways to do that, without going in and replacing all the
existing build systems with CMake (which is likely the route we'll
take for some, but doing all doesn't seem practical)?

A possibility is just to build static rather than shared libraries;
for quite a few cases that would mean nothing would need to be
installed.

Another one (which would be a bit more general, I think) is to replace
the build with a CMake wrapper, so the building bit calls the
underlying build script but the install part is all done in CMake. In
these cases the numbers of files is usually quite small, so doing that
shouldn't be too annoying, and would presumably produce the right
scripts to use in CPack.

Any better ideas (or problems I'm missing with the last idea I suggest)?


More information about the cmake-developers mailing list