[CMake] Two phase install?

Scott Aron Bloom scott at towel42.com
Wed Mar 23 17:49:45 EDT 2016


-----Original Message-----
From: Alan W. Irwin [mailto:irwin at beluga.phys.uvic.ca] 
Sent: Wednesday, March 23, 2016 2:48 PM
To: Scott Aron Bloom
Cc: cmake at cmake.org
Subject: Re: [CMake] Two phase install?

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
============

Thanks, the ExternalProject_Add is exactly what I needed a hint towards!!!





More information about the CMake mailing list