title: Ninja prepends any add_subdirectory(foo) to all paths resulting in error at FindFirstFileExA on windows with vcpkg
body: <p>I'm trying to port a small open source project to windows. I used vcpkg to install the one dependency (pcre2), added the recommended paths to the cmake environment:</p>
  <pre><code>-DVCPKG_TARGET_TRIPLET:String=x64-windows-static
  -DCMAKE_TOOLCHAIN_FILE=C:/Users/me/Documents/vcpkg/scripts/buildsystems/vcpkg.cmake
  </code></pre>
  <p>Now the cmake step succeeds, but the build step fails with:</p>
  <pre><code>ninja: error: FindFirstFileExA(src/d:/a/ssplit-cpp/ssplit-cpp/build): The filename, directory name, or volume label syntax is incorrect.
  </code></pre>
  <p>Obviously the problem is the <code>src</code> that appears before the volume, but I have no idea what in my environment would make it do that. The project can be found here: <a href="https://github.com/ugermann/ssplit-cpp" rel="nofollow noreferrer">https://github.com/ugermann/ssplit-cpp</a></p>
  <p>EDIT:</p>
  <p>The problem is the <code>add_subdirectory(foo)</code>. Calling it makes ninja prepend <code>foo</code> to all paths. Why is this happening? The problem is not in <code>vcpkg</code></p>
  <p>EDIT2: The issue appears with minimal <code>cmake</code> command in our github workflows:</p>
  <pre><code>cmakeAppendedArgs: '-G Ninja -DCMAKE_BUILD_TYPE=&quot;Debug&quot;'
  </code></pre>
  <p>EDIT3: Seems similar to <a href="https://stackoverflow.com/questions/31871972/cmake-add-subdirectory-error-only-with-cmake-command-line-but-not-cmake-gui-on-w">cmake add_subdirectory error only with cmake command line but not cmake-gui on windows (with source checked out at root of a drive letter)</a> except my project is not a root directory.</p>