[CMake] is it possible to download CMake modules at configure time?

radovan bast radovan.bast at irsamc.ups-tlse.fr
Fri Apr 5 12:03:21 EDT 2013


dear CMake developers and users,

first of all, a big thanks for the CMake developers
for a great product! we like CMake a lot.

we are extensively using CMake external project support
in combination with Git submodules in a number of larger
projects and that works nicely.

my question is: could i do something similar with CMake
modules? is it possible to start with a minimal core
CMakeLists.txt which would fetch other CMake modules from an
external public (Git) repository
and use them to configure the project?

the motivation for this is that we have several projects
with rather complex CMake infrastructures. the projects
are independent, live on different repositories, but the
CMake infrastructures are to a large extent overlapping.
currently we synchronize the CMake code between these projects
manually but this is not great and there is the risk that
the codes will diverge, that wheels will be reinvented,
and that improvements are not communicated between the projects.
this could be avoided if the CMake code was not explicitly
present but fetched from a repository which would also
enforce (or encourage) communicating all improvements
to the same place. everything that is generic and not project
specific would go into that external repo, only project specific
things would be kept in the minimal core CMakeLists.txt.

i will appreciate any pointers and suggestions
on how i could implement such a scheme.

thanks and best regards,
   radovan


More information about the CMake mailing list