[CMake] [Digital Signature Failure] FetchContent and multiple CMake projects

Dvir Yitzchaki Dvir.Yitzchaki at ceva-dsp.com
Sun Apr 15 08:56:35 EDT 2018


Check out Hunter package manager: https://github.com/ruslo/hunter

Regards,
Dvir

From: CMake <cmake-bounces at cmake.org> On Behalf Of Saad Khattak
Sent: Friday, April 13, 2018 02:06
To: Cmake Mailing List <cmake at cmake.org>
Subject: [Digital Signature Failure] [CMake] FetchContent and multiple CMake projects

Hi,

I have many independent CMake projects and most projects have external dependencies. Most of the projects have the same dependency e.g. Catch testing library.

Each library uses FetchContent so that it can be built independently by simply cloning its github repository, configuring and generating through CMake and then building. However, I would also like the ability for these projects to share the same dependency to save disk space (and compile time) if they detect that another project already has done FetchContent on a particular dependency.

Again, note that all projects are independent where their own repositories.

------------------------------------------ EXAMPLE ----------------------------------------------
To illustrate the setup: I have LibA, LibB, LibC, LibD, LibE etc. where each may have a dependency that is found to be the same. So, when LibA is the only one that is cloned, it uses FetchContent to clone the dependencies, build them, install them and the test executable linked to the dependencies properly.

Now LibB is cloned and it has some dependencies that LibA doesn't have but other dependencies that LibA 'does' use. Assuming LibA is already built successfully, I would like LibB to rely on LibA's dependencies, if found, otherwise LibB clones, generates and builds its own dependencies.

It is also possible that LibA was never cloned/built and thus LibB must clone/generate/build all dependencies.
------------------------------------------ END EXAMPLE ----------------------------------------------

To solve this issue, I am using a combination of find_package(...) and FetchContent, however the whole setup is starting to show cracks, is fragile and difficult to test and maintain. So now I am wondering whether there is a better way to about solving the issue.

Thank you,
Saad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180415/af8f30b2/attachment.html>


More information about the CMake mailing list