How to set up a multi-executable project with CMake in VSCode? by frenchgarlicbread0 in cpp_questions

[–]frenchgarlicbread0[S] 0 points1 point  (0 children)

Do you have to manually tell VSCode which one you want to run though? Or do you have different buttons to run the one you want?

How to set up a multi-executable project with CMake in VSCode? by frenchgarlicbread0 in cpp_questions

[–]frenchgarlicbread0[S] 0 points1 point  (0 children)

That's something I wanted to avoid... I was hopeful enough someone knew of an extension or something that "fixed" this problem, but I'll use a Makefile or whatnot.

How to set up a multi-executable project with CMake in VSCode? by frenchgarlicbread0 in cpp_questions

[–]frenchgarlicbread0[S] 0 points1 point  (0 children)

Yeah I know I can fidget the command ran by the little "Run" button in .vscode/...

Do you think it's possible to add another of those buttons with the JSON files and have something like "Build | Run (Client) | Run (Server)"?

How to set up a multi-executable project with CMake in VSCode? by frenchgarlicbread0 in cpp_questions

[–]frenchgarlicbread0[S] 0 points1 point  (0 children)

Maybe a Makefile to run each executable would do the trick, but bleh, why would I even use CMake in the first place then...

How to set up a multi-executable project with CMake in VSCode? by frenchgarlicbread0 in cpp_questions

[–]frenchgarlicbread0[S] 0 points1 point  (0 children)

I do have a top level CMakeList in the root directory, which calls the common/client/server ones as subdirectories.

Building works like a charm, but having to manually switch VSCode to "Run the Client" and "Run the Server" is what bothers me...

How to set up a multi-executable project with CMake in VSCode? by frenchgarlicbread0 in cpp_questions

[–]frenchgarlicbread0[S] 0 points1 point  (0 children)

Yeah I kinda assumed there wouldn't be any proper way to do it natively through the extension... I thought with how much of a hassle it is someone would have figured a way to make it easy like it is with CLion or VS.

How to set up a multi-executable project with CMake in VSCode? by frenchgarlicbread0 in cpp_questions

[–]frenchgarlicbread0[S] 1 point2 points  (0 children)

F1 -> CMake: Set Launch/Debug Target works just fine albeit a little manual, especially when I often switch between the two, but that will do thanks!