[CMake] How do you handle recursive dependencies in CMake

hemant at mnkcg.com hemant at mnkcg.com
Tue Jun 19 09:55:34 EDT 2018


Thanks much, Tim!

 

Hemant

 

From: CMake <cmake-bounces at cmake.org> On Behalf Of Tim Rae
Sent: Tuesday, June 19, 2018 9:39 AM
To: cmake at cmake.org
Subject: Re: [CMake] How do you handle recursive dependencies in CMake

 

Hi all,

 

I spent a bit of time working on this issue the last few days, and since I didn't see a satisfactory answer in this thread I thought I'd resurrect the thread since it's one of the first google hits.

it seems that all you need to do to solve the problem of transitive dependencies is make your package config files call find_package() / find_dependency() for their dependencies. I've posted some example code on a similar thread on stack overflow:

 

 <https://stackoverflow.com/a/50929353/2125915> https://stackoverflow.com/a/50929353/2125915

 

This is what has worked for me, and I believe it solves the problems discussed in this thread. I have only tested it at shallow levels of recursion, but I think it works. Please let me know if there is any problem.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180619/d6e8eb47/attachment.html>


More information about the CMake mailing list