私のプロジェクトでcmakeが依存関係を処理しようとしましたが、 しかし、私のシステムではcmakeがブーストできません。なぜ、cmake findBoostがシステムのブーストパスを見つけることができませんか?
cmake_minimum_required(VERSION 3.8)
project(QuineMccluskeyExample)
set(CMAKE_CXX_STANDARD 14)
if(MSVC)
set(CMAKE_CXX_FLAGS "/WX- /Wall /O2 /Ob2")
else()
set(CMAKE_CXX_FLAGS "-pthread -Wall -O3")
endif()
# header only library
add_library(QuineMccluskey INTERFACE)
target_include_directories(QuineMccluskey INTERFACE include/)
# example project source directories
set(EXAMPLES ${PROJECT_SOURCE_DIR}/examples)
set(SOURCE_FILES
${EXAMPLES}/main.cpp)
# Boost dependency
find_package(Boost 1.63.0 COMPONENTS REQUIRED
dynamic_bitset
config
core
move
static_assert
assert
exception
integer)
if(Boost_FOUND)
message("found BOOST: " ${BOOST_ROOT})
include_directories(${Boost_INCLUDE_DIR})
add_executable(QuineMccluskeyExample ${SOURCE_FILES})
else()
message("couldn't find boost")
endif()
これは私のCMakeLists.txtファイル であり、以下cmakeの出力ログの上
Boost version: 1.64.0
Boost include path: /usr/include
Could not find the following Boost libraries:
boost_dynamic_bitset
boost_config
boost_core
boost_move
boost_static_assert
boost_assert
boost_integer
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
あるfindBoostが私のシステムパスを探しせることの結果です。 私のシステムパスは/ usr/include/boostです パスcmakeはそれが正しいと言います。 という必要な依存関係のヘッダーがすべてあることを確認しましたが、何らかの理由でcmakeが見つからないことがあります。
手動で-DBOOST_ROOT = "/ usr/include"を指定すると同じ結果が得られました。
以下が、/ usr /含める/後押し
accumulators math
algorithm math_fwd.hpp
align mem_fn.hpp
aligned_storage.hpp memory_order.hpp
align.hpp metaparse
any.hpp metaparse.hpp
archive move
array.hpp mpi
asio mpi.hpp
asio.hpp mpl
assert.hpp msm
assign multi_array
assign.hpp multi_array.hpp
atomic multi_index
atomic.hpp multi_index_container_fwd.hpp
bimap multi_index_container.hpp
bimap.hpp multiprecision
bind next_prior.hpp
bind.hpp noncopyable.hpp
blank_fwd.hpp nondet_random.hpp
blank.hpp none.hpp
call_traits.hpp none_t.hpp
cast.hpp non_type.hpp
cerrno.hpp numeric
checked_delete.hpp operators.hpp
chrono operators_v1.hpp
chrono.hpp optional
circular_buffer optional.hpp
circular_buffer_fwd.hpp parameter
circular_buffer.hpp parameter.hpp
compatibility pending
compressed_pair.hpp phoenix
compute phoenix.hpp
compute.hpp pointee.hpp
concept pointer_cast.hpp
concept_archetype.hpp pointer_to_other.hpp
concept_check polygon
concept_check.hpp polymorphic_cast.hpp
config polymorphic_pointer_cast.hpp
config.hpp pool
container predef
context predef.h
convert preprocessor
convert.hpp preprocessor.hpp
core process
coroutine process.hpp
coroutine2 program_options
crc.hpp program_options.hpp
cregex.hpp progress.hpp
cstdfloat.hpp property_map
cstdint.hpp property_tree
cstdlib.hpp proto
current_function.hpp ptr_container
cxx11_char_types.hpp python
date_time python.hpp
date_time.hpp qvm
detail random
dll random.hpp
dll.hpp range
dynamic_bitset range.hpp
dynamic_bitset_fwd.hpp ratio
dynamic_bitset.hpp ratio.hpp
enable_shared_from_this.hpp rational.hpp
endian ref.hpp
exception regex
exception_ptr.hpp regex_fwd.hpp
fiber regex.h
filesystem regex.hpp
filesystem.hpp scoped_array.hpp
flyweight scoped_ptr.hpp
flyweight.hpp scope_exit.hpp
foreach_fwd.hpp serialization
foreach.hpp shared_array.hpp
format shared_container_iterator.hpp
format.hpp shared_ptr.hpp
function signal.hpp
functional signals
functional.hpp signals2
function_equal.hpp signals2.hpp
function.hpp signals.hpp
function_output_iterator.hpp smart_ptr
function_types smart_ptr.hpp
fusion sort
generator_iterator.hpp spirit
geometry spirit.hpp
geometry.hpp statechart
get_pointer.hpp static_assert.hpp
gil swap.hpp
graph system
hana test
hana.hpp thread
heap thread.hpp
icl throw_exception.hpp
implicit_cast.hpp timer
indirect_reference.hpp timer.hpp
integer token_functions.hpp
integer_fwd.hpp token_iterator.hpp
integer.hpp tokenizer.hpp
integer_traits.hpp tr1
interprocess tti
intrusive tuple
intrusive_ptr.hpp type_erasure
io type.hpp
io_fwd.hpp type_index
iostreams type_index.hpp
is_placeholder.hpp typeof
iterator type_traits
iterator_adaptors.hpp type_traits.hpp
iterator.hpp units
lambda unordered
last_value.hpp unordered_map.hpp
lexical_cast unordered_set.hpp
lexical_cast.hpp utility
limits.hpp utility.hpp
locale uuid
locale.hpp variant
local_function variant.hpp
local_function.hpp version.hpp
lockfree visit_each.hpp
log vmd
logic wave
make_default.hpp wave.hpp
make_shared.hpp weak_ptr.hpp
make_unique.hpp xpressive
あるブーストはarchlinuxレポ
そして、もう一つの質問に、最新のディストリビューション1.64_02です。 git CMakeプロジェクトにブースト依存関係を含める明確な方法はありますか? サブモジュールの使用は好きですか? 私は試しましたが、シンプルできれいなアイデアは出てきませんでした。手動
私の2番目の質問に答えることができますか?ブーストの依存関係をうまく処理するための「サブモジュールの方法」はありますか? –
そして、私はusr/lib/boostに何も持っていません –
あなたはどのようにブーストをインストールしましたか? 'sudo apt-get libboost-all-dev'をインストールしますか? – Nibor