Mohamed Benmahdjoub
Mohamed Benmahdjoub

Reputation: 1290

CMAKE - Add default command line arguments to a cmake project

I am creating and building a c++ project using cmake from scratch.
The executable requires command line arguments.
I am specifying them in Visual studio.

Is it possible to specify them by default when cmake builds the project (in my CmakeLists.txt for example) ? So that I (or others) won't need to specify these arguments each time I build the project for the first time (I would want to just run the project without worrying about that but still can change them in visual studio of course if needed) ?

enter image description here

Upvotes: 4

Views: 4580

Answers (1)

If you are using CMake 3.13 and above you can add the VS_DEBUGGER_COMMAND_ARGUMENTS property to your executable target in order specify those arguments.

Upvotes: 6

Related Questions