View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016057CMakeCMakepublic2016-04-09 09:582016-06-10 14:21
ReporterTatsuyuki Ishi 
Assigned ToRoger Leigh 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 3.5.1 
Target VersionCMake 3.6Fixed in VersionCMake 3.6 
Summary0016057: FindBoost: No imported target when components not specified
DescriptionHere's an example:
=============
project(...)
find_package(Boost REQUIRED)
add_executable(...)
target_link_libraries(... Boost::Boost)
*BOOM*
=============

But this works:
=============
find_package(Boost COMPONENTS system REQUIRED)
target_link_libraries(... Boost::Boost)
=============

This is hard to use, and should be considered as bug and fixed.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0040882)
Roger Leigh (developer)
2016-04-18 12:19

I looked at FindBoost.cmake to see if this is the case, but it should work if COMPONENTS is not used. It's set if Boost_FOUND is true and Boost_IMPORTED_TARGETS is true; the latter is true if a supported boost version is in use, which should be true unless you're using a truly ancient version or an unreleased version.

The patch proposed here:
https://github.com/Kitware/CMake/compare/master...rleigh-dundee:boost-import-default?expand=1 [^]
should make it get unconditionally defined. Could you possibly try it and let me know if it works for you?


Thanks,
Roger
(0040885)
Nils Gladitz (developer)
2016-04-19 08:22

That seems to work for me.

Boost_IMPORTED_TARGETS is unset since the function that sets it never gets called (when you don't specify components).
(0040893)
Roger Leigh (developer)
2016-04-19 16:37

Ah, makes sense. OK, I'll submit this shortly. By the way, in the original comment, you had

target_link_libraries(... Boost::Boost)

Note the capitalisation: it's Boost::boost.
(0040894)
Nils Gladitz (developer)
2016-04-19 16:49

I am not the original poster but I noticed that too :)
(0040895)
Roger Leigh (developer)
2016-04-19 17:22

I've merged my boost-import-default branch into next for testing, including a unit test to check that the Boost::boost target is defined when COMPONENTS was not used.

I'm not sure on the workflow for mantis here. Does the resolution get changed before or after the branch is merged? Or does anything else need doing here on my part?

Regards,
Roger
(0040898)
Brad King (manager)
2016-04-20 09:54

Re 0016057:0040895: Once the fix is in 'next' and you are confident it resolves the issue go ahead and mark it resolved here (but not closed).

Anyway, the fix is now in 'master':

FindBoost: Define Boost::boost for all boost versions
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c1b720e [^]
(0041188)
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-04-09 09:58 Tatsuyuki Ishi New Issue
2016-04-11 09:28 Brad King Assigned To => Roger Leigh
2016-04-11 09:28 Brad King Status new => assigned
2016-04-18 12:19 Roger Leigh Note Added: 0040882
2016-04-19 08:22 Nils Gladitz Note Added: 0040885
2016-04-19 16:37 Roger Leigh Note Added: 0040893
2016-04-19 16:49 Nils Gladitz Note Added: 0040894
2016-04-19 17:22 Roger Leigh Note Added: 0040895
2016-04-20 09:54 Brad King Note Added: 0040898
2016-04-20 09:54 Brad King Status assigned => resolved
2016-04-20 09:54 Brad King Resolution open => fixed
2016-04-20 09:54 Brad King Fixed in Version => CMake 3.6
2016-04-20 09:54 Brad King Target Version => CMake 3.6
2016-06-10 14:21 Kitware Robot Note Added: 0041188
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team