Cmake 忽略了我关于在 boost::beast 存储库中在哪里找到 boost 的所有指令
Cmake ignores all my directives on where to find boost in boost::beast repository
我正在使用 Ubuntu 16.04(带有 boost 1.58),我必须使用 boost::beast
开发一个项目。所以我得到了最新版本的 boost (1.67),现在我正在尝试编译 the beast repository 来玩这些例子。
我以最简单的方式编译了boost。我做了 ./bootstrap
然后 ./bjam
,它编译得很好(我用了它)。
我需要什么:我需要 cmake 识别我希望它找到版本 1.67,而不是系统中的版本 (/usr/bin
)。
为什么我不能从我的系统中删除存储库版本的 boost? 因为它会删除我系统中的许多其他依赖项,并且我开发其他使用 Ubuntu 16.04 为基准。
我尝试了什么:
在 CMakeLists.txt
文件中我得到 from the repository, I added these lines (before everything and after the project name) based on the docs:
set(BOOST_ROOT "/path/to/compiled/boost/")
set(BOOSTROOT "/path/to/compiled/boost/")
set(BOOST_LIBRARYDIR "/path/to/compiled/boost/stage/lib/")
set(BOOST_INCLUDEDIR "/path/to/compiled/boost/")
set(Boost_NO_SYSTEM_PATHS ON)
当我尝试编译 beast(以便它也编译示例)时,出现错误:
fatal error: boost/utility/string_view.hpp: No such file or directory
我什至从我的系统中卸载了cmake并自己编译了一个,Cmake 3.11.2。
我还能做什么?请指教
编辑:以下是在评论中建议启用 Boost_DEBUG
后 cmake 的输出:
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1121 ] _boost_TEST_VERSIONS = 1.67.0;1.67
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1123 ] Boost_USE_MULTITHREADED = TRUE
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1125 ] Boost_USE_STATIC_LIBS =
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1127 ] Boost_USE_STATIC_RUNTIME =
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1129 ] Boost_ADDITIONAL_VERSIONS =
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1131 ] Boost_NO_SYSTEM_PATHS = ON
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1199 ] Declared as CMake or Environmental Variables:
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1201 ] BOOST_ROOT = /path/to/compiled/boost/
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1203 ] BOOST_INCLUDEDIR = /path/to/compiled/boost/
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1205 ] BOOST_LIBRARYDIR = /path/to/compiled/boost/stage/lib/
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1207 ] _boost_TEST_VERSIONS = 1.67.0;1.67
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1282 ] Include debugging info:
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1284 ] _boost_INCLUDE_SEARCH_DIRS = /path/to/compiled/boost/;/path/to/compiled/boost//include;/path/to/compiled/boost/;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1286 ] _boost_PATH_SUFFIXES = boost-1_67_0;boost_1_67_0;boost/boost-1_67_0;boost/boost_1_67_0;boost-1_67;boost_1_67;boost/boost-1_67;boost/boost_1_67
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1306 ] location of version.hpp: /path/to/compiled/boost/boost/version.hpp
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1330 ] version.hpp reveals boost 1.67.0
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1416 ] guessed _boost_COMPILER = -gcc54
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1426 ] _boost_MULTITHREADED = -mt
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1502 ] _boost_RELEASE_ABI_TAG = -
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1504 ] _boost_DEBUG_ABI_TAG = -d
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1567 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /path/to/compiled/boost/stage/lib/;/path/to/compiled/boost//lib;/path/to/compiled/boost//stage/lib;/path/to/compiled/boost/lib;/path/to/compiled/boost/../lib;/path/to/compiled/boost/stage/lib;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH_boost_LIBRARY_SEARCH_DIRS_DEBUG = /path/to/compiled/boost/stage/lib/;/path/to/compiled/boost//lib;/path/to/compiled/boost//stage/lib;/path/to/compiled/boost/lib;/path/to/compiled/boost/../lib;/path/to/compiled/boost/stage/lib;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1883 ] Boost_FOUND = 1
-- Boost version: 1.67.0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/temp/beast/build
Beast 附带的 CMakeLists.txt 仅用于在 beast 存储库位于 "in-tree" 时生成一个 Visual Studio 项目文件(boost 超级项目的一部分,不是你想要的进行升级安装)。这在文档中有解释:
https://github.com/boostorg/beast#building
我正在使用 Ubuntu 16.04(带有 boost 1.58),我必须使用 boost::beast
开发一个项目。所以我得到了最新版本的 boost (1.67),现在我正在尝试编译 the beast repository 来玩这些例子。
我以最简单的方式编译了boost。我做了 ./bootstrap
然后 ./bjam
,它编译得很好(我用了它)。
我需要什么:我需要 cmake 识别我希望它找到版本 1.67,而不是系统中的版本 (/usr/bin
)。
为什么我不能从我的系统中删除存储库版本的 boost? 因为它会删除我系统中的许多其他依赖项,并且我开发其他使用 Ubuntu 16.04 为基准。
我尝试了什么:
在 CMakeLists.txt
文件中我得到 from the repository, I added these lines (before everything and after the project name) based on the docs:
set(BOOST_ROOT "/path/to/compiled/boost/")
set(BOOSTROOT "/path/to/compiled/boost/")
set(BOOST_LIBRARYDIR "/path/to/compiled/boost/stage/lib/")
set(BOOST_INCLUDEDIR "/path/to/compiled/boost/")
set(Boost_NO_SYSTEM_PATHS ON)
当我尝试编译 beast(以便它也编译示例)时,出现错误:
fatal error: boost/utility/string_view.hpp: No such file or directory
我什至从我的系统中卸载了cmake并自己编译了一个,Cmake 3.11.2。
我还能做什么?请指教
编辑:以下是在评论中建议启用 Boost_DEBUG
后 cmake 的输出:
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1121 ] _boost_TEST_VERSIONS = 1.67.0;1.67
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1123 ] Boost_USE_MULTITHREADED = TRUE
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1125 ] Boost_USE_STATIC_LIBS =
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1127 ] Boost_USE_STATIC_RUNTIME =
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1129 ] Boost_ADDITIONAL_VERSIONS =
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1131 ] Boost_NO_SYSTEM_PATHS = ON
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1199 ] Declared as CMake or Environmental Variables:
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1201 ] BOOST_ROOT = /path/to/compiled/boost/
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1203 ] BOOST_INCLUDEDIR = /path/to/compiled/boost/
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1205 ] BOOST_LIBRARYDIR = /path/to/compiled/boost/stage/lib/
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1207 ] _boost_TEST_VERSIONS = 1.67.0;1.67
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1282 ] Include debugging info:
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1284 ] _boost_INCLUDE_SEARCH_DIRS = /path/to/compiled/boost/;/path/to/compiled/boost//include;/path/to/compiled/boost/;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1286 ] _boost_PATH_SUFFIXES = boost-1_67_0;boost_1_67_0;boost/boost-1_67_0;boost/boost_1_67_0;boost-1_67;boost_1_67;boost/boost-1_67;boost/boost_1_67
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1306 ] location of version.hpp: /path/to/compiled/boost/boost/version.hpp
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1330 ] version.hpp reveals boost 1.67.0
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1416 ] guessed _boost_COMPILER = -gcc54
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1426 ] _boost_MULTITHREADED = -mt
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1502 ] _boost_RELEASE_ABI_TAG = -
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1504 ] _boost_DEBUG_ABI_TAG = -d
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1567 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /path/to/compiled/boost/stage/lib/;/path/to/compiled/boost//lib;/path/to/compiled/boost//stage/lib;/path/to/compiled/boost/lib;/path/to/compiled/boost/../lib;/path/to/compiled/boost/stage/lib;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH_boost_LIBRARY_SEARCH_DIRS_DEBUG = /path/to/compiled/boost/stage/lib/;/path/to/compiled/boost//lib;/path/to/compiled/boost//stage/lib;/path/to/compiled/boost/lib;/path/to/compiled/boost/../lib;/path/to/compiled/boost/stage/lib;NO_CMAKE_SYSTEM_PATH;NO_SYSTEM_ENVIRONMENT_PATH
-- [ /home/user/Programs/cmake/cmake-install/share/cmake-3.11/Modules/FindBoost.cmake:1883 ] Boost_FOUND = 1
-- Boost version: 1.67.0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/temp/beast/build
Beast 附带的 CMakeLists.txt 仅用于在 beast 存储库位于 "in-tree" 时生成一个 Visual Studio 项目文件(boost 超级项目的一部分,不是你想要的进行升级安装)。这在文档中有解释: https://github.com/boostorg/beast#building