1、VS
在项目目录中找到.vs目录--->launch.vs.json
{ "version": "0.2.1", "defaults": {}, "configurations": [ { "type": "default", "project": "CMakeLists.txt", "projectTarget": "app.exe (src\\app.exe)", "name": "app.exe (src\\app.exe)", "args": [ "-XXX" //此处为运行时传入的命令行参数为 -XXX ] }, { "type": "default", "project": "CMakeLists.txt", "projectTarget": "", "name": "CMakeLists.txt" } ] }
2、Qt
打开Qt项目--->选择左侧边栏中项目--->选择运行--->在Command line arguments栏中添加需要传入的命令行参数即可(如下图红框)
标签:CMakeLists,exe,cmake,Qt,app,---,VS,命令行 From: https://www.cnblogs.com/citrus/p/18041363