MBulli / SmartCommandlineArgs

A Visual Studio Extension which aims to provide a better UI to manage your command line arguments
GNU General Public License v2.0
98 stars 35 forks source link

support of cmake VS2022 projects #169

Open yalov opened 6 months ago

yalov commented 6 months ago

Hello,

I have added the set_property in the CMakeLists.txt as you specified in the https://github.com/MBulli/SmartCommandlineArgs/wiki/Cmake-support but in the Visual Studio GUI, in the extension tab, the green plus button ("add command line argument") is not active, so I can't add an argument

Irame commented 6 months ago

Hi, thanks for using the extension and reaching out to us.

I am guessing that you open your CMake project directly with Visual Studio. We currently don't support this use case because it does not involve a solution file which we rely on at the moment. If I find some time I will look into this issue.

The wiki refers to a setup, where you generate a solution file (*.sln) with CMake (e.g. cmake -B builds -G 'Visual Studio 17 2022') and then open this file inside Visual Studio.

yalov commented 4 months ago

The cmake VS2022 projects have the cmd arguments in PROJECT\.vs\launch.vs.json, as "args" value per project target:

{
  "version": "0.2.1",
  "defaults": {},
  "configurations": [
    {
      "type": "default",
      "project": "CMakeLists.txt",
      "projectTarget": "name.exe",
      "name": "name.exe",
      "args": [
        "-v"
      ]
    },
    {
      "type": "cppgdb",
      "project": "CMakeLists.txt",
      "projectTarget": "name",
      "name": "name",
      "debuggerConfiguration": "gdb",
      "MIMode": "gdb",
      "args": [
        "-v"
      ],
      "env": {}
    }
  ]
}

so the extension probably could support cmake projects by changing the args value, if the target is specified?