cpm-cmake / CPM.cmake

📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

when use cache the depends lib appeared outside the project in clion

oskycar opened this issue · comments

image

My main project is cpm-test. I used CPM to add some libs in lib lib2 directory's CMakelists.txt. when no cache used , the source file was download and showd in cmake-build-debug/_deps dir . But when I set the CPM_SOURCE_CACHE var, all the depends lib was showed outside the project , It seems strange and inconvenient

That's just where the source code lives, as we currently don't copy it from the cache to the build directory. CLion is correct in showing the outside location as external dependencies are external and shouldn't be touched by users. Not sure if there is a good solution without copying the dependencies.

Copying the cache to build could actually be a valid option in the future, especially for dealing with potential problems with the upcoming patches feature (#558), but for now there is no plan for an implementation.

Personally and at work, I've set the cache to be project specific (<project_root>/extern or <project_root>/out/deps).

This has in my opinion a few advantages:
You don't have to think about Patches messing up some other project.
The cache doesn't get "polluted" with stuff that isn't needed anymore when deleting a project.
In CLion the project overview should be what you expect (though I don't use CLion)

The additional storage space from having the same deps downloaded 10+ times, turned out to be irrelevant.