microsoft / microsoft/vscode-cmake-tools

Have vscode-cmake-tools respect PROJECT_LABEL variable.

Open
#2,825 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: Project Outline View help wanted
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

Brief Issue Summary

A property can be set for targets called PROJECT_LABEL that will create a display name to use in IDEs. Currently I don't believe that vscode-cmake-tools respects when the variable is set.

Creating target and setting PROJECT_LABEL property:
image

How the target shows up in the project outline. No dice.
image

And how the target shows up in the target select menu:
image

It's a nice to have when you have many targets and want to organize them alphabetically without having to sift through whatever naming convention you use.

CMake Tools Diagnostics
{
  "os": "win32",
  "vscodeVersion": "1.72.2",
  "cmtVersion": "1.12.27",
  "configurations": [
    {
      "folder": "c:\\Users\\My Name\\Documents\\program",
      "cmakeVersion": "3.23.0",
      "configured": true,
      "generator": "Ninja Multi-Config",
      "usesPresets": true,
      "compilers": {
        "C": "C:/msys64/mingw64/bin/gcc.exe",
        "CXX": "C:/msys64/mingw64/bin/g++.exe"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug",
      "Release",
      "RelWithDebInfo"
    ],
    "requests": [
      "file:///c%3A/Users/My%20Name/Documents/program/engine/src/program/tests/containers/fiber_test.c",
      "file:///c%3A/Users/My%20Name/Documents/program/testbench/src/game.c",
      "file:///c%3A/Users/My%20Name/Documents/program/testbench/src/entry.c"
    ],
    "responses": [
      {
        "uri": "file:///c%3A/Users/My%20Name/Documents/program/engine/src/program/tests/containers/fiber_test.c",
        "configuration": {
          "includePath": [
            "c:/users/My Name/documents/program/engine/src",
            "c:/users/My Name/documents/program/engine/include",
            "c:/users/My Name/documents/program/build/mingw-w64-gcc/engine/include",
            "c:/vulkansdk/1.2.198.1/include"
          ],
          "defines": [],
          "compilerPath": "c:/msys64/mingw64/bin/gcc.exe",
          "compilerArgs": [],
          "compilerFragments": [
            "-g -fvisibility=hidden",
            "-Wall",
            "-Wextra",
            "-Wpedantic",
            "-Wvla",
            "-Wno-unused-parameter",
            "-std=gnu17"
          ]
        }
      },
      {
        "uri": "file:///c%3A/Users/My%20Name/Documents/program/testbench/src/game.c",
        "configuration": {
          "includePath": [
            "c:/users/My Name/documents/programc/engine/src",
            "c:/users/My Name/documents/program/engine/include",
            "c:/users/My Name/documents/program/build/mingw-w64-gcc/engine/include",
            "c:/vulkansdk/1.2.198.1/include"
          ],
          "defines": [
            "program_engine_shared_EXPORTS"
          ],
          "compilerPath": "c:/msys64/mingw64/bin/gcc.exe",
          "compilerArgs": [],
          "compilerFragments": [
            "-g -fvisibility=hidden",
            "-Wall",
            "-Wextra",
            "-Wpedantic",
            "-Wvla",
            "-Wno-unused-parameter",
            "-std=gnu17"
          ]
        }
      },
      {
        "uri": "file:///c%3A/Users/My%20Name/Documents/program/testbench/src/entry.c",
        "configuration": {
          "includePath": [
            "c:/users/My Name/documents/program/engine/src",
            "c:/users/My Name/documents/program/engine/include",
            "c:/users/My Name/documents/program/build/mingw-w64-gcc/engine/include",
            "c:/vulkansdk/1.2.198.1/include"
          ],
          "defines": [
            "program_engine_shared_EXPORTS"
          ],
          "compilerPath": "c:/msys64/mingw64/bin/gcc.exe",
          "compilerArgs": [],
          "compilerFragments": [
            "-g -fvisibility=hidden",
            "-Wall",
            "-Wextra",
            "-Wpedantic",
            "-Wvla",
            "-Wno-unused-parameter",
            "-std=gnu17"
          ]
        }
      }
    ],
    "partialMatches": [],
    "targetCount": 41,
    "executablesCount": 10,
    "librariesCount": 2,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}
Debug Log
[main] Building folder: program 
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build all
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build "c:/Users/My Name/Documents/program/build/mingw-w64-gcc" --config Debug --target all
[build] ninja: no work to do.
[cmakefileapi-parser] Read reply folder: c:\Users\My Name\Documents\program\build\mingw-w64-gcc\.cmake\api\v1\reply
[build] Build finished with exit code 0
[extension] [8278] cmake.build finished (returned 0)
Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the cmakefile-api-parser reads target metadata and how target names are passed to the project outline and target select menu. Confirm the PROJECT_LABEL property is available in the CMake File API response. Done means targets using PROJECT_LABEL display that value consistently in both locations, with existing target names preserved when it is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript
Domain
build-system, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.