Tuesday, February 6, 2024

[SOLVED] How to disable Proposed CMake Script Changes in Visual Studio 2022

Issue

This pops up every time i create a new file in CMake project. Please tell me how to turn this off.

EDIT:

After few hours i have realized that stackoverflow can't load the image i posted for some reason, so i will try to recreate the window using symbols.

_______________________________________________
| Preview Changes - CMake            [?]  [X] |
|_____________________________________________|
| Proposed CMake Script Changes               |
|_____________________________________________|
|                                             |
|  [v] PROJECT_NAME\CMakeLists.txt            |
|       [v] target_sources                    |
|                                             |
|                                             |
|_____________________________________________|
| Preview CMake Script Changes                |
|_____________________________________________|
|                                             |
| My CMake stuff here.                        |
| The proposed change is to put all my source |
| files here manually one by one instead of   |
| using file(GLOB_RECURSE "include/*.h") like |
| i always do.                                |
|_____________________________________________|
|                                             |
|                       [ Apply  ] [ Cancel ] |
|_____________________________________________|

Solution

It is possible to disable this by going to Options -> CMake -> General -> and unchecking the setting: "Enable automatic CMake script modification for file operations from folder view"

Window with the CMake setting

This will disable these notifications each time you do a file operation, such as adding files.

This works for both Visual Studio 2022 and Visual Studio 2019. I have not verified other versions.



Answered By - Deru
Answer Checked By - Mary Flores (WPSolving Volunteer)