On Thu, 8 Feb 2018 at 4:52 am, Saad Khattak <[email protected]> wrote:

> Hi,
>
> I have a lot of projects with many dependencies. Support ProjE depends on
> ProjD which in turn depends on ProjB and ProjC where ProjB depends on ProjA.
>
> If ProjA, is updated, I would like some way to trigger the generate/build
> (or just build, assuming the projects are already generated) ProjB, ProjD
> and ProjE (not ProjC as it did not depend on ProjA).
>
> I realize this is not possible without ProjA somehow knowing about its
> dependent projects. And so I don't mind if it's a new master project or
> super build. What I would like however is for CMake to generate this master
> project for me (as it already knows the dependency hierarchy). Then, it'll
> just be a matter of building this 'superbuild' which in turn detects that
> ProjA has been updated, and updates/builds all its dependents.
>
> I can do this manually by ExternalProject_Add, but that is just error
> prone and not at all automated. If the projects go into the double or
> triple digit range, you can see why manually preparing the superbuild
> project is not a good solution.
>

An alternative to the superbuild approach is the new FetchContent module
that has been added in the upcoming 3.11 release. You can see the docs for
it here:

https://cmake.org/cmake/help/git-master/module/FetchContent.html

It may be more convenient for the situation you describe. There’s even a
somewhat similar example in those docs for inter project dependencies along
the lines of your case.



> --
Craig Scott
Melbourne, Australia
https://crascit.com
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to