I’m tring to package files needed to compile a sub library in my project. The project is a collection of multiple libraries and i would like to let users use all of them or pick only the one they need through FetchContent.
right now, I’m listing all the files by hand by doing something like:
This works pretty well but I’m worried that it will not scale. Currently, I need to think about all the files needed and then I need test the compilation.
So, I’m wondering if there is a way to list all the files needed to compile a target and its dependencies (transitive or direct).
Thank you for you answer. I want to be able to provide these sub-libraries for use with Fetchcontent. I also let them install the libraries if they need but most of the time i guess they will like to add it by simply fetching it. My current idea is based on this blog.
I check your link and CPM.make, however I’m not sure I understand how it works. It still looks like you mentioning all the files by hand. Not sure though, let me know if I’m wrong.
I do get your idea, but I really don’t know where to start and I really don’t what to do trials and error to get the right files that I need to include…