boostorg / cmake

CMake support infrastructure Boost submodule
86 stars 26 forks source link

`accumulators` library not usable when adding boost 1.82 as a submodule #39

Closed greg7mdp closed 1 year ago

greg7mdp commented 1 year ago

When using boost 1.82 as a submodule (add_subdirectory(boost)), I can use the boost libraries successfully, except for accumulators.

When I try adding the dependency to Boost::accumulators, I have:

CMake Error at libraries/boost/libs/accumulators/CMakeLists.txt:15 (target_link_libraries):
  The link interface of target "boost_accumulators" contains:

    Boost::numeric_ublas

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.
pdimov commented 1 year ago

The reason for this is that Boost.uBLAS is still missing CMake support. I tried to add it before, and the maintainers reverted my change. Then I submitted a PR (https://github.com/boostorg/ublas/pull/142), but they haven't merged it yet. You could comment on the PR and request it to be merged - let's hope they listen. :-)

greg7mdp commented 1 year ago

Thank you @pdimov , I did add a comment requesting the merge of this PR.

greg7mdp commented 1 year ago

Meanwhile I can solve my issue by adding these lines in my CMakeLists.txt to provide the Boost::numeric_ublas target.

add_library(boost_numeric_ublas INTERFACE)
add_library(Boost::numeric_ublas ALIAS boost_numeric_ublas)