VS Qt - cmake项目中添加运行时命令行参数
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栏中添加需要传入的命令行参数即可(如下图红框)
博客园文作者:Citrusliu
博文地址:https://www.cnblogs.com/citrus