Package: cmake
Version: 2.8.0-5
Severity: minor
When using
find_package(Boost COMPONENTS thread REQUIRED)
-lpthread is not added to the link command, causing the link to fail if
binutils-gold (which has --no-add-needed behavior as default) is used.
More informations can be found at
http://wiki.debian.org/qa.debian.org/FTBFS#A2009-11-02Packagesfailingbecausebinutils-gold.2BAC8-indirectlinking
See attached testcase.
Thanks,
Ludovico
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.31-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages cmake depends on:
ii cmake-data 2.8.0-5 CMake data files (modules, templat
ii libc6 2.10.2-2 GNU C Library: Shared libraries
ii libcurl3-gnutls 7.19.7-1 Multi-protocol file transfer libra
ii libexpat1 2.0.1-7 XML parsing C library - runtime li
ii libgcc1 1:4.4.2-8 GCC support library
ii libstdc++6 4.4.2-8 The GNU Standard C++ Library v3
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime
cmake recommends no packages.
cmake suggests no packages.
-- no debconf information
#include <boost/thread/recursive_mutex.hpp>
boost::recursive_mutex recursive_mutex;
int main() {
boost::recursive_mutex::scoped_lock(recursive_mutex);
return 0;
}
cmake_minimum_required(VERSION 2.6)
set(Boost_DEBUG ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost COMPONENTS thread REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(foo foo.cc)
# The following line should be enough as foo.cc is not using pthreads
target_link_libraries(foo ${Boost_LIBRARIES})
# The next line fixes the error
#target_link_libraries(foo ${Boost_LIBRARIES} -lpthread)