parsley72
parsley72

Reputation: 9087

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

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?

Upvotes: 12

Views: 14987

Answers (3)

starball
starball

Reputation: 52293

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

Upvotes: 4

Bruce1999
Bruce1999

Reputation: 1

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

Upvotes: -1

Michael_Cache
Michael_Cache

Reputation: 105

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

Upvotes: 7

Related Questions