CMake中的find_软件包(Boost)将Boost 1.75检测为Boost 1.77
我最近使用git存储库将我的Boost安装升级到Boost 1.75。现在,当运行CMake中的find_软件包(Boost)将Boost 1.75检测为Boost 1.77,boost,cmake,Boost,Cmake,我最近使用git存储库将我的Boost安装升级到Boost 1.75。现在,当运行find_package(Boost)时,它总是告诉我它找到了boost1.77.0。这是CMake中的错误还是Boost(或我自己的代码)中的错误 全输出: CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message): New Boost version may have incorrect or missing depen
find_package(Boost)
时,它总是告诉我它找到了boost1.77.0。这是CMake中的错误还是Boost(或我自己的代码)中的错误
全输出:
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:283 (find_package)
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:283 (find_package)
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:283 (find_package)
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:283 (find_package)
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:283 (find_package)
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:283 (find_package)
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:283 (find_package)
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:283 (find_package)
CMake Warning at /usr/share/cmake/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindBoost.cmake:1476 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake/Modules/FindBoost.cmake:2086 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:283 (find_package)
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost: Found unsuitable version "1.77.0", but required is
exact version "1.75" (found /opt/boost/include, found components: system
filesystem mpi program_options serialization thread chrono date_time
atomic)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:592 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake/Modules/FindBoost.cmake:2344 (find_package_handle_standard_args)
CMakeLists.txt:283 (find_package)
-- Configuring incomplete, errors occurred!
您确定
find_package(Boost)
找到的是您的Boost安装,而不是其他安装吗find_包
缓存其结果,因此升级Boost后,您需要清理项目的生成目录(或者至少从中删除cmakcache.txt
文件)。你做到了吗?我在本地安装了Boost 1.76,在/opt/
中安装了1.75,因此我很确定它不会检测到任何其他内容。此外,1.77仅在git上被标记,但尚未发布,而且cmake在删除CMakeCache和CmakeFiles后仍能找到它。请在cmake处理find_包(Boost)时显示(添加到问题帖子)cmake生成的确切输出
@Tsyvarev:添加了outputRuncmake
,带有附加选项-DBoost\u DEBUG=ON
,因此它将打印更多有关搜索Boost的消息。其中一条消息应该包含version.hpp
头文件的位置,CMake将其用于提取Boost版本。检查,该标题的路径是否合理。该头文件可以将版本定义为BOOST\u version
或BOOST\u LIB\u version
宏的值。该宏的值是多少?