Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99513

Running custom commands with VS Code and CMake Tools

$
0
0

I am using VS Code with the CMake Tools extension, and I would like to run a simple MPI program. Everything compiles just fine, and I can run my code in the terminal using

mpiexec -n 6 "path-to-my-workspace\build\my-executable.exe"

However, I would like to set things up so that this gets executed automatically when I press Control + Shift + P >"CMake: Run Without Debugging" (or Shift F5).

I read in the CMake Tools documentation that I could create new launch targets in a launch.json file. However, the VS Code documentation states that

The launch.json file is used to configure the debugger in Visual Studio Code.

I want this for debug, but also for release. Should I still use a launch.json file? I had the same problem in the past when I needed to pass arguments to my main function. What is the right way to do that in VS Code with CMake Tools?


Viewing all articles
Browse latest Browse all 99513

Trending Articles