View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014720CMakeModulespublic2014-01-27 10:272014-06-02 08:38
ReporterArne Nordmann 
Assigned To 
Platform64bitOSLinux UbuntuOS Versionprecise+quantal
Product VersionCMake 2.8.7 
Target VersionFixed in VersionCMake 2.8.11 
Summary0014720: FindBoost handles pthread different on first and second run
DescriptionWhen calling the macro find_package(Boost thread), I get different results for ${Boost_LIBRARIES} the first and the second time I execute cmake.

First time, ${Boost_LIBRARIES} contains '/usr/lib/;pthread', the second time, ${Boost_LIBRARIES} just contains '/usr/lib/' (without pthread).
Steps To ReproduceExecute the following cmake script twice (also attached):

> project("Test FindBoost")
> cmake_minimum_required(VERSION 2.8)
> find_package(Boost REQUIRED thread)
> message(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}")

Reproduced on several Ubuntu precise and quantal machines.
Additional InformationAn obvious workaround, calling the find boost macro twice in a cmake script, doesn't help.
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (154 bytes) 2014-01-27 10:27 [Show Content]

related to 0010692closedPhilip Lowman FindBoost fails to add -lpthread 

Brad King (manager)
2014-01-27 10:44

The FindBoost module has had a major overhaul since 2.8.7.

Please try with CMake 2.8.11 or higher, preferably the latest release.
Nils Gladitz (developer)
2014-01-27 10:46

When I run vanilla cmake I get:
  -- Boost_LIBRARIES: /usr/lib/
both on the first and second run.

Debian/Ubuntu seem to patch their FindBoost.cmake to add pthread: [^]
Arne Nordmann (reporter)
2014-01-27 10:58

I tested in a Ubuntu saucy VM with cmake (which comes with saucy). First and second run produce the same result, which is

 -- Boost_LIBRARIES: /usr/lib/x86_64-linux-gnu/;/usr/lib/x86_64-linux-gnu/

which is fine.
Brad King (manager)
2014-01-27 11:07

Re 0014720:0035000: Great, thanks for reporting back.
Robert Maynard (manager)
2014-06-02 08:38

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2014-01-27 10:27 Arne Nordmann New Issue
2014-01-27 10:27 Arne Nordmann File Added: CMakeLists.txt
2014-01-27 10:44 Brad King Note Added: 0034998
2014-01-27 10:46 Nils Gladitz Relationship added related to 0010692
2014-01-27 10:46 Nils Gladitz Note Added: 0034999
2014-01-27 10:58 Arne Nordmann Note Added: 0035000
2014-01-27 11:07 Brad King Note Added: 0035001
2014-01-27 11:07 Brad King Status new => resolved
2014-01-27 11:07 Brad King Resolution open => fixed
2014-01-27 11:07 Brad King Fixed in Version => CMake 2.8.11
2014-06-02 08:38 Robert Maynard Note Added: 0036091
2014-06-02 08:38 Robert Maynard Status resolved => closed

Copyright © 2000 - 2018 MantisBT Team