Issue Understanding the CPM

I am wondering if someone could help me understand an issue that I have with the CPM. I can integrated it, no problem. But for some reason, when I build my project. CPM starts to mix up everything. It creates a lib, and bin directory in my build directory and shuffles everything around. I don’t exactly know what happened that CPM doesn’t put things in their respected -build, -install folders anymore.

I should probably mention that I’m using the ExternalPackage as well, and direct them to the same _deps directory. But, I don’t think that should cause the problem. I feel that somehow, CPM triggers an install target for some reason! I do not yet have an install target yet.

Thanks for your help in advance!

Are you talking about this CPM?

Yes! I should have perhaps mentioned it! :man_facepalming:t2:

Consider creating a issue/conversation on the CPM.cmake github repo. The maintainer is very friendly and has helped me in the past.

If you can though please try and create a SSCCE since it’s really difficult give meaningful feedback/help without one.

Thanks, I have already asked it there, but I thought I will share it here maybe someone could help.

SSCCE is usually a good idea, and I usually do that in this forum, but I felt this should be self explanatory enough, which appears to be not. I see if I can put together something minimal! Thanks again! :slight_smile:

1 Like

Could you post the link to your question on the CPM GitHub?

Sure, here. I have added an piece of code to show what is happening and I may have found the issue but I don’t know how to solve it.

I ended up tracking this down and it was an issue with the libraries CMake code assuming it was the top level project. Making it unfriendly to be consumed via add_subdirectory

See here: