[CMake] Two phase install?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Mar 23 17:47:57 EDT 2016


On 2016-03-23 20:25-0000 Scott Aron Bloom wrote:

> Here is my problem.
>
> The project I have creates an application, that is needed to build the rest of the project.
>
> To imagine it, imagine the application is a custom yacc/lex based parser that reads in a file and generates an output file.
>
> In order for the application to run correctly, it needs an install step.  However, the results of the application, are part of the final install.
>
> Is there anyway to say "build this, and create its install area" and afterwards run the rest of the requirements for install?

Yes.  I suggest you build and install your application and the rest of your
project as two separate CMake projects with a common install-tree prefix.

Of course, you could stop there with two completely independent
projects that you (and your users) learn to build and install in the
correct order. However, CMake allows you to organize such multiple
builds and installs with ExternalProject_Add.  I like and use that a
lot for large numbers of different projects that depend on each other,
and you might also find it useful for your case of just two
independent projects.

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); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); 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