Cmake 中的 Boost 文件系统版本错误

wfj*_*ns1 3 c++ boost cmake boost-filesystem conan

我正在开发一个 C++ 程序,该程序使用 cmake 和 conan 进行编译,并提升 1.7.4。最近,我开始收到:错误:#error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION returned!= 3。

该程序直到最近都运行良好,现在才开始出现此错误。

这是我的cmake代码

#find external libraries with Conan
 ----------------------------------------------------------
conan_check(VERSION 1.0.0 REQUIRED)
message(STATUS "Downloading dependency libraries with Conan")

 #The boost dependency is tricky.
 #Need 1.74 for correct behavior, and need options to successfully build on mac
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
     #workaround for https://github.com/conan-io/conan-center-index/issues/4097
    set(CONAN_OPTIONS boost:without_fiber=True boost:without_nowide=True)
else()
    set(CONAN_OPTIONS )
endif()

conan_cmake_run(REQUIRES boost/1.74.0 jsoncpp/[>=1.8.4] eigen/[>=3.3.7] cgal/[>=5.1]
    OPTIONS
        ${CONAN_OPTIONS}
    BUILD missing
    CMAKE_TARGETS
    BASIC_SETUP
    UPDATE)
Run Code Online (Sandbox Code Playgroud)

我相信 boost 1.7.4 仅支持文件系统 v3,有没有办法检查我的 Boost 文件系统版本?任何潜在的修复将不胜感激。

Nic*_*man 5

我们有同样的问题。我通过添加修复了它(本地)

'boost:filesystem_version = 3'
Run Code Online (Sandbox Code Playgroud)

到我们的 conanfile.py default options {}。看来最近对配方的改变是罪魁祸首:https://github.com/conan-io/conan-center-index/pull/11988