Skip to content

Commit 35b3834

Browse files
authored
Add docs on using existing cache without cmake-server
1 parent d7b36a2 commit 35b3834

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/build/cmake-projects-in-visual-studio.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ When you open an existing CMake cache file (*`CMakeCache.txt`*), Visual Studio d
6363

6464
You can add an existing CMake cache to an open project. It's done the same way you'd add a new configuration. For more information, see our blog post on [opening an existing cache in Visual Studio](https://devblogs.microsoft.com/cppblog/open-existing-cmake-caches-in-visual-studio/).
6565

66+
> [!NOTE]
67+
> The default existing cache experience relies on cmake-server, which has been removed from CMake in version 3.20. In Visual Studio 2019 16.10 and later, you will need to do one of the following in order to continue using existing cache functionality:
68+
> 1. Manually install CMake with version 3.19 or lower. Then set the `cmakeExecutable` property in your existing cache configuration to that CMake.
69+
> 2. In your existing cache configuration, set the `cacheGenerationCommand` property (see the [CMakeSettings.json reference page](cmakesettings-reference.md) for more details). This allows Visual Studio to request the necessary CMake file-based API files.
70+
> 3. Ensure the CMake file-based API files are requested when generating your cache prior to opening it in Visual Studio. The instructions for how to do this are described below in "Advanced CMake cache troubleshooting".
71+
6672
### Advanced CMake cache troubleshooting
6773

6874
Visual Studio uses the CMake [file-based API](https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html) (in versions 3.14 and later) to populate the editor with information specific to your project structure. For more information, see the C++ team blog post on [multi-root workspaces and file-based API](https://devblogs.microsoft.com/cppblog/visual-studio-code-cmake-tools-extension-multi-root-workspaces-and-file-based-api/).

0 commit comments

Comments
 (0)