question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a command that returns the resolved value of cmake.buildDirectory

See original GitHub issue

Brief Issue Summary

Using ${config:cmake.buildDirectory} in launch.json with visual cpp debugger doesn’t work. After a successful cmake configure the ${config:cmake.buildDirectory} is not correctly resolved. In my example in settings.json the cmake.buildDirectory looks like this: "cmake.buildDirectory": "${workspaceFolder}/../CMakeBuild/vscode/NSW-51770/${buildKit}/${buildType}",

The ${buildKit} and ${buildType} are not resolved but just copied into the resulting string.

Expected:

cmake.buildDirectory is correctly resolved

Platform and Versions

  • Operating System: Windows
  • CMake Version: 3.14
  • VSCode Version: 1.34
  • CMake Tools Extension Version: 1.1.3
  • Compiler/Toolchain: Visual C++ 2019

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
zrnocommented, Jul 17, 2019

Thanks for the answer. I can not use launchTargetDirectory as I have multiple targets in my project. The launch.json has several targets listed. Example launch.json:

"configurations": [
    {
        "name": "Target1 Launch",
        "program": "${config:cmake.buildDirectory}/Target1/Target1.exe",
    },
    {
        "name": "Target2 Launch",
        "program": "${config:cmake.buildDirectory}/Target2/Target2.exe",
    },

Using ${config:cmake.buildDirectory} isn’t working. Any solution for that?

0reactions
bobbrowcommented, Jul 22, 2019

As I have been reviewing the existing issues, I found that there is already one tracking this request. #564

Read more comments on GitHub >

github_iconTop Results From Across the Web

CMake 3.25.1 Documentation
If a command in the project sets the type to PATH or FILEPATH then the <value> will be converted to an absolute path....
Read more >
file — CMake 3.25.1 Documentation
This command is dedicated to file and path manipulation requiring access to the ... it is determined by the value of CMAKE_OBJDUMP if...
Read more >
ExternalProject — CMake 3.25.1 Documentation
The ExternalProject_Add() function creates a custom target to drive download, update/patch, configure, build, install and test steps of an external project:.
Read more >
Cross Platform Make - CMake
If COMMENT is set, the value will be displayed as a message before the commands are executed at build time. If APPEND is...
Read more >
Master Index CMake 2.8.12
The "cmake" executable is the CMake command-line interface. ... add_test command. Note that ctest expects to find a test file in the build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found