View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016020CMakeCMakepublic2016-03-14 22:002016-06-10 14:21
ReporterTom Jakubowski 
Assigned ToRoger Leigh 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 3.5 
Target VersionCMake 3.5.1Fixed in VersionCMake 3.5.1 
Summary0016020: FindBoost "Automatically add missing component dependencies" fails with header-only libraries
DescriptionIf only some separately-compiled Boost libraries are installed, so that Boost components like Boost.Atomic and Boost.DateTime are used header-only, find_package(Boost REQUIRED COMPONENTS thread) will fail with:

    :1647 (message):
      Unable to find the requested Boost libraries.

      Boost version: 1.56.0

      Boost include path: /opt/foo/deps-64-10/include

      Could not find the following Boost libraries:

              boost_atomic
              boost_chrono
              boost_date_time

If a full installation of Boost 1.56, with all optional separately-compiled libraries, is used instead, then the FindBoost() call succeeds.

This is a regression from CMake 3.4. It seems like https://github.com/Kitware/CMake/commit/01c80acdbdadf3811bc0a6cab0c28469a4e9f5b7 [^] is probably responsible.

Also related to bug 15767.
TagsNo tags attached.
Attached Files

 Relationships
related to 0016013closedRoger Leigh FindBoost: iostreams depends on regex [3.5 regression] 

  Notes
(0040692)
Brad King (manager)
2016-03-15 10:03

Does the change linked in 0016013:0040691 address this?
(0040700)
Brad King (manager)
2016-03-16 13:13

I've reproduced this error as reported in the description. The change linked in 0016013:0040691 *does* fix it.

In the described environment, however, the FindBoost.Test test case in CMake fails with errors like:

 CMake Error at CMakeLists.txt:7 (add_executable):
   Target "test_boost_tgt" links to target "Boost::chrono" but the target was
   not found. Perhaps a find_package() call is missing for an IMPORTED
   target, or an ALIAS target is missing?

 CMake Error at CMakeLists.txt:7 (add_executable):
   Target "test_boost_tgt" links to target "Boost::date_time" but the target
   was not found. Perhaps a find_package() call is missing for an IMPORTED
   target, or an ALIAS target is missing?

 CMake Error at CMakeLists.txt:7 (add_executable):
   Target "test_boost_tgt" links to target "Boost::atomic" but the target was
   not found. Perhaps a find_package() call is missing for an IMPORTED
   target, or an ALIAS target is missing?

This is because the Boost::thread imported target still records that it depends on the other targets even though they were never created.

This is tricky because when using the Boost::thread imported target we have no way to indicate whether we want the header-only part or to really link to the library. Currently CMake is assuming the latter. Perhaps that is okay because for header-only usage one really only needs the include directory and does not need all the imported targets to get it.
(0040702)
Brad King (manager)
2016-03-16 13:17

The change linked in 0016013:0040691 has been merged to the 'release' branch for inclusion in CMake 3.5.1. That resolves the issue raised here.

Further discussion raised in 0016020:0040700 would be better held on the mailing list if the status quo is not sufficient.
(0041225)
Kitware Robot (administrator)
2016-06-10 14:21

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-03-14 22:00 Tom Jakubowski New Issue
2016-03-15 08:56 Brad King Assigned To => Roger Leigh
2016-03-15 08:56 Brad King Status new => assigned
2016-03-15 08:56 Brad King Relationship added related to 0016013
2016-03-15 10:03 Brad King Note Added: 0040692
2016-03-15 10:05 Brad King Target Version => CMake 3.5.1
2016-03-16 13:13 Brad King Note Added: 0040700
2016-03-16 13:17 Brad King Note Added: 0040702
2016-03-16 13:17 Brad King Status assigned => resolved
2016-03-16 13:17 Brad King Resolution open => fixed
2016-03-16 13:17 Brad King Fixed in Version => CMake 3.5.1
2016-06-10 14:21 Kitware Robot Note Added: 0041225
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team