[Pkg-cmake-team] Bug#912074: Workaround

Martin Quinson martin.quinson at ens-rennes.fr
Sun Oct 28 16:56:48 GMT 2018


Hello,

I think I now understand the problem. stacktrace is not really a
component of Boost, but a library that provides several components.
See [1] for the full list of components. 

Then, even the recent versions of cmake seem to ignore about this
library. This can be patched from your CMakeLists.txt even without
modifying cmake files by adding the relevant _Boost_*_HEADERS
variables before finding the Boost package.

These definitions could be placed in FindBoost.cmake, in the
definition of the function _Boost_COMPONENT_HEADERS:

  set(_Boost_STACKTRACE_BASIC_HEADERS     "boost/stacktrace.hpp")
  set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
  set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")

You may want to provide more specific values for each library by using
something from boost/stacktrace/details/??? I don't think that this is
mandatory because cmake is also looking for the library to load, so
this should do the trick.

At the end the following CMakeLists.txt works for me:

----------[ CMakeLists ]----------
cmake_minimum_required(VERSION 2.8.8)

project(BugReport C)

set(_Boost_STACKTRACE_BASIC_HEADERS     "boost/stacktrace.hpp")
set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")
  
find_package(Boost COMPONENTS stacktrace_basic stacktrace_backtrace stacktrace_addr2line)
if(Boost_FOUND)
  message(STATUS "Cool.")
endif()  
----------[ output ]----------
-- The C compiler identification is GNU 8.2.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
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   stacktrace_basic
--   stacktrace_backtrace
--   stacktrace_addr2line
-- Cool.
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/toto
----------[ done ]----------


[1] https://www.boost.org/doc/libs/1_65_1/doc/html/stacktrace/configuration_and_build.html

Thanks, Mt.

-- 
L'informatique soit ça marche pas, soit ca marchait avant qu'on y touche.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-cmake-team/attachments/20181028/7e5af876/attachment.sig>


More information about the Pkg-cmake-team mailing list