Build presets do not show up in Visual Studio

I placed the following CMakePresets.json at the root of my source directory. But, the build presets do not get displayed at all in Visual Studio. What might be the error? I am using the latest 17.8.3 version of Visual Studio 2022 community edition.

{
   "version": 4,
   "cmakeMinimumRequired": 
   {
      "major": 3,
      "minor": 24,
      "patch": 0
   },
   "configurePresets": 
   [
      {
         "name": "base",
         "description": "Sets generator, build and install directory",
         "hidden": true,
         "generator": "Ninja",
         "binaryDir": "${sourceDir}/../../build/External",
         "cacheVariables": {
            "CMAKE_INSTALL_PREFIX": "${sourceDir}/../../bin"
         }
      },
      {
         "name": "windows-base",
         "description": "Sets C++ compiler and hostOS",
         "hidden": true,
         "inherits": [ "base" ],
         "generator": "Visual Studio 17 2022",
         "architecture": 
         {
            "value": "x86",
            "strategy": "external"
         },
         "cacheVariables": 
         {
            "CMAKE_CXX_COMPILER": "cl"
         },
         "vendor": 
         {
            "microsoft.com/VisualStudioSettings/CMake/1.0": 
            {
               "hostOS": [ "Windows" ]
            }
         }
      },
      {
         "name": "windows-x64-base",
         "description": "Sets x64 arch",
         "hidden": true,
         "inherits": [ "windows-base" ],
         "architecture": 
         {
            "value": "x64",
            "strategy": "external"
         }
      },
      {
         "name": "windows-x64-debug-config",
         "description": "Sets common definitions for debug builds",
         "inherits": [ "windows-x64-base" ],
         "cacheVariables": {
            "bgfx_DIR": "${sourceDir}/../../bin/external/bgfx/windows-x64-debug/lib/cmake"
         }
      },
      {
         "name": "windows-x64-release-config",
         "description": "Sets common definitions for release builds",
         "inherits": [ "windows-x64-base" ],
         "cacheVariables": {
            "bgfx_DIR": "${sourceDir}/../../bin/external/bgfx/windows-x64-release/lib/cmake"
         }
      },
      {
         "name": "windows-x64-relWithDebInfo",
         "description": "Sets common definitions for relWithDebInfo builds",
         "inherits": [ "windows-x64-base" ],
         "cacheVariables": {
            "bgfx_DIR": "${sourceDir}/../../bin/external/bgfx/windows-x64-relWithDebInfo/lib/cmake"
         }
      },
      {
         "name": "linux-base",
         "description": "Sets compilers, build type",
         "inherits": "base",
         "vendor": 
         {
            "microsoft.com/VisualStudioSettings/CMake/1.0": 
            {
               "hostOS": [ "Linux" ]
            }
         }
      },
      {
         "name": "linux-debug",
         "inherits": "linux-base",
         "architecture": 
         {
            "strategy": "external"
         },
         "cacheVariables": 
         {
            "CMAKE_BUILD_TYPE": "Debug"
         }
      },
      {
         "name": "linux-release",
         "inherits": "linux-base",
         "architecture": 
         {
            "strategy": "external"
         },
         "cacheVariables": 
         {
            "CMAKE_BUILD_TYPE": "Release"
         }
      },
      {
         "name": "linux-relWithDebInfo",
         "inherits": "linux-base",
         "architecture": 
         {
            "strategy": "external"
         },
         "cacheVariables": 
         {
            "CMAKE_BUILD_TYPE": "RelWithDebInfo"
         }
      }
   ],
   "buildPresets": [
	   {
			"name": "windows-x64-debug",   
			"configurePreset": "windows-x64-debug-config",
			"configuration": "Debug"
	   },
	   {
			"name": "windows-x64-release",   
			"configurePreset": "windows-x64-release-config",
			"configuration": "Release"
	   },	
	   {
			"name": "windows-x64-relWithDebInfo",   
			"configurePreset": "windows-x64-relWithDebInfo-config",
			"configuration": "RelWithDebInfo"
	   }	   
   ]   
}
1 Like