You can have a look at what @matthiasnoback wrote on this topic. In the end, it’s similar to what @moriglia proposed with the `–runner` option. This approach can be automated by adding a task into VSCode as discussed in that thread. That discussion on GitHub may also be of help Integrating fpm with text editors (Sublime, Atom, VS Code) · fortran-lang/fpm · Discussion #479 · GitHub .
If you go for the install trick: build and install can be executed together using a .rsp file and creating your custom command.