My question is somewhat similar to this SO but not the same.
I created a HelloWorld
program with the following:
add_executable( HelloWorld ${SRC} )
When I generate a project file (for example a Visual Studio .sln file, or an XCode .xcodeproj file). I want to hit the run button and pass in some command line arguments to HelloWorld
when it executes the program, like the following:
./HelloWorld --gtest_filter=Test_Cases1*
Also see this SO for how this is done in Visual Studio.
Is it possible to do this in CMakeList file? If not, why?
CMake 3.13.0 looks like it will add support for this in the form of the following target properties:
VS_DEBUGGER_COMMAND_ARGUMENTS
- Sets the local debugger command line arguments for Visual Studio C++ targets.VS_DEBUGGER_ENVIRONMENT
- Sets the local debugger environment for Visual Studio C++ targets.It extends use with these commands, available since CMake 3.12:
VS_DEBUGGER_COMMAND
- Sets the local debugger command for Visual Studio C++ targets.VS_DEBUGGER_WORKING_DIRECTORY
- Sets the local debugger working directory for Visual Studio C++ targets.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With