Re: How do you handle recursive dependencies in CMake

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: How do you handle recursive dependencies in CMake

Tim Rae-2
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:


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.


--

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 | Threaded
Open this post in threaded view
|

Re: How do you handle recursive dependencies in CMake

hemant

Thanks much, Tim!

 

Hemant

 

From: CMake <[hidden email]> On Behalf Of Tim Rae
Sent: Tuesday, June 19, 2018 9:39 AM
To: [hidden email]
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:

 

 

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.

 


--

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