title: Passing command line arguments to Visual Studio using CMake for profile guided optimization
body: <p>I'm using <code>CMake</code> for a <code>C++</code> project. I'm trying to use <a href="https://docs.microsoft.com/en-us/cpp/build/reference/profile-guided-optimizations?view=vs-2017" rel="nofollow noreferrer"><code>profile guided optimization</code></a> so I need to also pass command line arguments to the <code>Release</code> mode version of my binary. <code>Visual Studio</code> needs this to create a performance profile. I already have a <code>launch.vs.json</code> configuration for the <code>Debug</code> mode binary with command line arguments:</p>
  
  <pre><code>{
    "version": "0.2.1",
    "defaults": {},
    "configurations": [
      {
        "name": "MyProject",
        "project": "CMakeLists.txt",
        "projectTarget": "MyProject.exe",
        "type": "default",
        "args": [
          "...", "..."
        ]
      }
    ]
  }
  </code></pre>
  
  <p>When I switch to <code>Release</code> mode and choose the <code>MyProject</code> startup item, <code>Visual Studio</code> shows the following error message:</p>
  
  <pre><code>Unable to start debugging. The startup project could not be launched.
  </code></pre>
  
  <p>Why does it not work that way? I also cannot setup another profile and make <code>Visual Studio</code> recognize it in <code>Release</code> mode but it works fine in <code>Debug</code> mode.</p>