How can I disable CMake in some project folders of a VSCode workspace?
Asked Answered
S

3

11

I have a project that uses git-repo so it contains multiple repos. The only way I can find of supporting this in VSCode is to use multi-root workspaces and add each repo as a separate folder within the workspace. Some of these repos use CMake but some don't. I find that when I open the workspace I get messages for these repos like:

CMakeLists.txt was not found in the root of the folder 'MyFolder'

then VSCode attempts to setup CMake by creating a Build directory containing a bunch of default files. I also get:

CMake Tools would like to configure IntelliSense for the 'MyFolder' folder.

Is there any way to tell CMake to ignore a folder, maybe a setting in the .code-workspace file?

Sauerkraut answered 9/4, 2020 at 3:1 Comment(2)
Not the answer to your question, but this issue (still open as of this comment) may be related. For those who said yes to allow CMake to configure IntelliSense and want to undo it, just remove the configurationProvider key in .vscode/c_cpp_properties.json.Barrelhouse
did not work for mePepe
S
6

I guess you installed Cmake Tools extension in VScode, it will automatically run when a folder is opened. To avoid run cmake on specific folder, you can try create .vscode/settings.json on your folder. And set "cmake.configureOnOpen": false

Set answered 7/6, 2022 at 9:59 Comment(4)
I have set this setting to be false but I still get the pop-up with CMakeLists.txt selection, any recommendation?Plumbo
Who's upvoting this? This is CMake Tools issue #2338. There is currently no setting to get rid of the warning.Latvian
this setting doesn't existCameroncameroon
didn't work for me tooFall
L
2

If you're on CMake Tools 1.13.40+, try using the cmake.sourceDirectory setting and specify an array of the CMake source directories you want to configure with CMake Tools.

You may also be interested in

Lippizaner answered 14/11, 2023 at 18:29 Comment(1)
cmake.ignoreCMakeListsMissing works fine.Byproduct
P
0

Do not install "CMake Tools", install only "CMake".

Prolamine answered 14/11, 2023 at 11:11 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Bulla

© 2022 - 2024 — McMap. All rights reserved.