Learning Conan right now, I am trying to rewrite part of my CMake files to use conan instead of other package managers like CPM and the CMake built-in FetchContent_Declare function. Among other packages, I am using the followings with corresponding versions:
fmt: 9.1.0
spdlog: 1.11.0
I can fetch them both and build & run my code using CPM but FetchContent_Declare but using conan, I get the following version conflict error which I don't understand why it happens:
ERROR: Version conflict: spdlog/1.11.0->fmt/10.0.0, ->fmt/9.1.0.
My conanfile.py looks like below:
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain
class CompressorReceipe(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeDeps"
def requirements(self):
self.requires("nlohmann_json/3.11.2")
self.requires("spdlog/1.11.0")
self.requires("fmt/9.1.0")
self.requires("catch2/2.13.9")
self.requires("cxxopts/3.1.1")
def generate(self):
tc = CMakeToolchain(self)
tc.user_presets_path = False
tc.generate()
and looking into the spdlog dependeny info on the conan center I can only see that it depends on fmt/9.1.0 and not 10.0.0 as it complains about in the error:
For testing purpose, I upgraded my fmt to 10.0.0 and it can compile but still, I don't understand why this error is happening while there shall be no version conflict according to the spdlog info on the conan center.
My environemnt is Linux via WSL and the compiler is gcc.