[CMake] install phase policies

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed May 23 11:34:02 EDT 2007


On 2007-05-23 14:32+0200 Jesper Eskilson wrote:

> Hi all,
>
> I'm wondering about how (large) CMake projects handle the "install"
> phase with respect to incremental building and debugging. Do people
> always "install" before running/testing/debugging, or is it common to
> be able to run/test/debug directly from the build output directory?
>
> I would ideally like to be able to place executables/dlls etc. in a
> position such that the can be run directly without having to do the
> install phase, but CMake does not let me specify the output directory
> on a per-target basis.
>

PLplot is an intermediate-sized project where we do both install-tree tests
and build-tree tests.  Of course, the install-tree tests are for the
convenience of PLplot binary-package users.  Our primary motivation for
build-tree tests is for the convenience of developers (so they don't have to
type "make install" and switch to doing install-tree tests for every little
change they make).  However, when we did autotools-based builds (back in the
dark ages a year ago... :-) ) it took a rather large developer effort to
have reliable build-tree tests. (Unless you are careful, autotools will link
to stale install-tree libraries rather than the freshly built libraries that
are necessarily scattered all over the build tree.) Thus, under autotools
the developer-convenience factor of working build-tree tests proved to be
somewhat ephemeral, and I always felt negative about our autotools-based
build-tree tests in consequence.

Fast forward to today with our CMake-based build system for PLplot, and I
have suddenly become enthusiastic about build-tree based tests of our
software because all the build-tree linking hassles are taken care of
automatically by CMake (including rpath considerations so the build-tree
libraries are automatically found at run-time).  Thus, build-tree testing is
little maintenance burden at all. If you encapsulate all your build-tree
test scripts under ctest all the developer has to do to check his changes is
type "make" and "make test".

I don't have any windows experience, but my understanding from talking with
the PLplot windows developers is all is not so rosy in that build-tree case
because windows doesn't have the rpath facility.  Those experienced with
windows may be able to help you work around that issue with the windows
tool chain.

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