This pull request #1196 added new feature to automatic configure CMake when saving CMakeLists.txt.
This is a great feature that integrates CMake projects with IntelliSense.
However, there were things I wanted to turn off this feature.
Specifically, when working on a project that has multiple CMakeLists.txt, running CMake configure every time CMakeLists.txt is saved will hinder my work.
Imagine a project with the following structure:
.
+-- include
| +-- CMakeLists.txt // Add `foo.hpp`, etc header files to project.
| +-- foo.hpp
+-- src
| +-- CMakeLists.txt // Add `cpp.hpp`, etc source files to project.
| +-- foo.cpp
+-- CMakeLists.txt // Calls `add_subdirectory(include)` and `add_subdirectory(src)` as aggregators.
My project has many source and header files, I have divided the project source file declarations in this way.
This project is using Qt. The problem is that Qt must perform the task of scanning the source files and generating additional source files (Qt MOC sources) every time CMake configure time.
I have to update the CMakeLists.txt twice to add the header and source files.
CMake configure starts when the first CMakeLists.txt is saved, and it also starts scanning the source.
I can't work on it until I've finished scanning the source.
Could you add an option to turn off the this feature to get around the problem?
I'm sure there are others besides me who would like to turn this feature off for projects that perform time-consuming tasks in the CMake configure step.
+1
+1
+1
I'm working on a workspace and there's only one folder has CMakeList.txt, everytime I modify&save it, vscode always shows error about something like "no CMakeList in other folder"

even though I click the "Don't show again", it still appear everytime.
@fatfatson we should fix that, but did you try clicking the "Locate" button to tell the extension where the CMakeLists.txt file is? Or you can also set the cmake.sourceDirectory setting manually.
@fatfatson or are you saying you have multiple folders added to a workspace and only one of them has a CMakeLists.txt (and it's not the one called 'pi' in your screenshot)? If that is the case, can you create a new issue for that since this issue is covering a different problem? Thank you!
I agree this is critical to be able to opt out from a feature like this. In fact, I would have even done it as an _opt in_ feature. A cmake run can have many unexpected side effects, it can call any command.
IMHO, this is very dangerous to let it _run on save_, without the user's blessing.
Yes we are going to fix this for the soon upcoming 1.4.1 update release.
Yes we are going to fix this for the soon upcoming 1.4.1 update release.
Awesome, it's been tough when I do mass find replaces and get spammed with hundreds of "Configuration is already in progress." blasting my window.
@fatfatson or are you saying you have multiple folders added to a workspace and only one of them has a CMakeLists.txt (and it's not the one called 'pi' in your screenshot)? If that is the case, can you create a new issue for that since this issue is covering a different problem? Thank you!
Not the OP but I also have this problem. In my case I have some folders added to the workspace that do not have CMakeLists. What's worse is when I click "Don't show again" it seemingly turns off the CMake extension (none of the shortcuts work any more, status bar items disappear) until I manually run the "Configure" command from the command palette.
Looking forward to being able to disable configure-on-save
This should be fixed in CMake Tools 1.4.1 which was published today.
Let us know if you encounter any issues with this release.
@andreeis seems to have resolved the issues for me, thank you
@andreeis Thank you!
Most helpful comment
Yes we are going to fix this for the soon upcoming 1.4.1 update release.