[CMake] Copying cmake generated files to another machine
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Sun Dec 6 12:31:44 EST 2009
On 2009-12-06 11:33-0500 steve naroff wrote:
> Hi, I work on llvm/clang (a client of cmake).
> For development, cmake is wonderful (no big issues).
>
> For deployment, cmake's inability to copy it's generated project files to
> another machine is causing us some grief. The scenario is quite simple: I
> want to copy the llvm/clang source tree over another machine (running the
> same OS/tools) and build it *without* having to rerun cmake and generate
> *new* project files. Without this ability, it requires the target machine
> have cmake installed (which isn't convenient for some clients that want to
> build/use/master the result of the llvm/clang build). What was a 1 step
> process (open the project file) now becomes a 3 step process (install cmake,
> run it to generate the project file, open the project file).
>
> Last time I checked (about a year ago) the usage model I've outlined wasn't
> supported. Is this still the case? Is there any workaround?
Hi Steve:
I don't think you got good advice before because there is a simple solution
(unless I have completely misunderstood what you need). It's always (at
least back to a number of years ago when I first started with CMake/CPack)
been the case with CMake/CPack that a source distribution just packages
whatever is in the source tree (subject to a CPACK_SOURCE_IGNORE_FILES regex
to exclude any part of the source tree you desire). So if you do an
in-source build (i.e., top level of build tree identical with top-level of
source tree) or better a separate build tree whose top level is a unique
subdirectory of the source tree, then your source distribution tarball will
contain everything generated by cmake. Whether or not your "source"
distribution tarball contains generated binaries and libraries in addition
to whatever is generated by the cmake command depends on whether you do a
full build (or not) before generating the "source" tarball with "make
package_source".
BTW, if you are unfamiliar with how to set up a source package with
CMake/CPack, CMake itself does this as well as many other projects (such
as PLplot).
Above I have confined myself to your question about a convenient way to copy
CMake-generated files from the "original" machine to the "cloned" machine,
However, I can immediately think of at least two caveats you should be aware
of for the above scenario to actually work as a build system on your cloned
machines and others here may think of more.
(1) Dependent libraries (whose locations are found by cmake on your original
machine) must all be located in identical places on your "cloned" machines.
(2) Your build system cannot use cmake at build time (e.g., one of the
extremely useful cmake -E commands cannot be used in any custom commands
or custom targets).
It sounds from your description above "running the same OS/tools" you don't
have to worry about (1), and (2) may not be an issue for your particular
case as well, but I thought I had better mention these caveats here for
others who may read this in the future.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
More information about the CMake
mailing list