-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete Cache and Reconfigure with FetchContent #3173
Comments
Thanks for the report! I'm guessing this is happening because "Delete Cache and Reconfigure" literally deletes the |
This is very critical issue when dealing with multiple massive libraries. It must be resolved as soon as possible |
#3783 This PR should have given a setting that resolves this, could you try the |
I am having the same problem. cmake --fresh essentially does it for the cmake project, however it ignores fetchcontent. Is there any cmake command which does this functionality for fetchcontent? |
@stertingen Deleting CMakeCache.txt inside _deps is enough. |
@xavgru12 Did you try the |
@gcampbell-msft |
@xavgru12 How does it work for you though? Either way everything is going to get regenerated (for the most part), so deleting the entire build dir ensures that things happen as you desire and correctly. |
@gcampbell-msft |
@xavgru12 It sounds like what you're suggesting might be that we could improve our "delete cache and reconfigure" step to, if you're using a cmake.exe version past 3.24, we could actually utilize the --fresh argument, and it would solve this issue. Am I understand that correctly? It looks like in 3.30 there was a policy added that fixes the fetchcontent issue. It sounds like there is some work we could do here, but in the meantime, the |
@gcampbell-msft |
@xavgru12 Do you notice performance differences when deleting the entire build directory? It's regenerating everything either way, correct? In which case, the solution has the same impact? |
Since this fixes the issue and I did some small testing and didn't find any performance difference, this is determined to be a good solution, though it could be more refined. Since it solves this bug, I'm going to close it. However, we're happy to consider an improvement request to make it more refined rather than deleting the entire build dir. Please create an issue for this, and we'd also be happy to take an OSS contribution! Thanks for all your help and contributions. |
@gcampbell-msft |
@xavgru12 I would agree, however, in a quick test, after a reconfigure, building through cmake still causes a rebuild of the obj/binary files. And yes, I would encourage you to create a bug here: https://gitlab.kitware.com/cmake/cmake/-/issues |
@gcampbell-msft |
Brief Issue Summary
I'm having a CMake project with dependencies which are pulled using FetchContent.
CMake creates build directories and cache files at
build/_deps
which are not cleared when running "Delete Cache and Reconfigure".This usually breaks when the generator is changed (Make vs Ninja).
Steps to Reproduce:
build/_deps
As a workaround, I manually delete the
_deps
directory when reconfiguring.CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: