Skip to content

Add note about configuring CMake in $PROJECT/.vscode/settings.json (if CMake extension installed) #2

@GavinRay97

Description

@GavinRay97

Configuring my VS Code settings like this was the only way I could manage to get it compiled (though that's probably something on my end) 😅

Might be useful for other folks? When you configure like this, you can just click the "build" button from the CMake extension inside of VS Code 👍

Requires ms-vscode.cmake-tools: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools

{
  "cmake.sourceDirectory": "${workspaceFolder}",
  "cmake.generator": "Ninja",
  "cmake.environment": {
    "VCPKG_ROOT": "C:\\Users\\rayga\\projects\\vcpkg",
    "VCPKG_DEFAULT_TRIPLET": "x64-windows-static"
  },
  // Values passed here are equivalent to "-DCMAKE_" flags
  "cmake.configureSettings": {
    "CMAKE_BUILD_TYPE": "Debug",
    "CMAKE_EXPORT_COMPILE_COMMANDS": 1,
    "CMAKE_TOOLCHAIN_FILE": "C:\\Users\\rayga\\Projects\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
  }
}

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions