[CMake] Making sure dependent projects are up-to-date

Saad Khattak saadrustam at gmail.com
Fri Jan 12 22:41:00 EST 2018


Hi,

Let's say I have several CMake enabled libraries that have their own
respective build directories and have been installed:

LibA
LibB (depends on A)
LibC
LibD (depends on LibC and LibA)

I then create a new executable project ProjExe that depends on LibD. Now, I
am working on LibA, LibB, LibC, LibD and ProjExe simultaneously (e.g.
building up functionality in the libraries that the executable uses, fixing
bugs etc.).

What I would like, is a way to ensure that when ProjExe is built, it first
checks whether LibD is up-to-date (i.e. does it have any out of source
build files?), if not, it builds LibD first. But LibD depends on LibC and
LibA, and then LibD ensures that LibC and LibA are up-to-date before
building itself.

Is something like this possible in CMake? This is  similar to the
'solution' concept in Visual C++ where a 'solution' can have several
projects. ProjExe in the solution can be dependent on external libraries
(like the above) and they are part of the 'solution' and are checked to be
up-to-date before ProjExe is compiled/linked.

Thanks,
Saad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180113/60cb2998/attachment.html>


More information about the CMake mailing list