gulrak / filesystem

An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.
MIT License
1.31k stars 168 forks source link

The CMake build definition doesn't contain a version #148

Closed robbert-vdh closed 1 year ago

robbert-vdh commented 2 years ago

I recently replaced Boost.Filesystem with ghc::filesystem in yabridge. I'm using Meson, and during ordinary builds the ghc_filesystem dependency resolves to a subproject wrap dependency contained within the repo, but when packaging yabridge for distro repos they usually want to use their own repo dependencies instead of vendored ones. In theory that should work without any changes if the library ships a pkgconfig file or a CMake build definition (in ghc::filesystem's case though I had to manually add modules : 'ghcFilesystem::ghc_filesystem' to the definition because it somehow doesn't export that by default like most other CMake dependencies do). The problem is that while this in theory works, the definitions in /usr/lib/cmake/ghc_filesystem don't contain any versions. So the following dependency will fail to resolve as the version bound cannot be satisfied:

ghc_filesystem_dep = dependency('ghc_filesystem', modules : 'ghcFilesystem::ghc_filesystem', version : '>=1.5.0')

Could you please consider adding a version number to the project? Using unversioned dependencies can otherwise result in all sorts of problems.

gulrak commented 2 years ago

Should be doable, Thanks for the report.