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.