0

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:

-DVCPKG_TARGET_TRIPLET:String=x64-windows-static
-DCMAKE_TOOLCHAIN_FILE=C:/Users/me/Documents/vcpkg/scripts/buildsystems/vcpkg.cmake

Now the cmake step succeeds, but the build step fails with:

ninja: error: FindFirstFileExA(src/d:/a/ssplit-cpp/ssplit-cpp/build): The filename, directory name, or volume label syntax is incorrect.

Obviously the problem is the src 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: https://github.com/ugermann/ssplit-cpp

EDIT:

The problem is the add_subdirectory(foo). Calling it makes ninja prepend foo to all paths. Why is this happening? The problem is not in vcpkg

EDIT2: The issue appears with minimal cmake command in our github workflows:

cmakeAppendedArgs: '-G Ninja -DCMAKE_BUILD_TYPE="Debug"'

EDIT3: Seems similar to 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) except my project is not a root directory.

XapaJIaMnu
  • 1,408
  • 3
  • 12
  • 28
  • It smells like something wrong with your CMake settings and vcpkg is unrelated to that problem. Please, show the whole command line you use to invoke CMake. This line probably includes specification of [CMake generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) (with `-G` option). Also show output of CMake when it configures the project – Tsyvarev Apr 23 '21 at 22:16
  • @Tsyvarev added the cmake command used. You can also see the complete windows workflow at the repo. – XapaJIaMnu Apr 24 '21 at 09:35

0 Answers0