MantisBT - CMake
View Issue Details
0013574CMakeCMakepublic2012-10-05 15:412015-01-05 08:39
Peter Kuemmel 
 
normalminoralways
closedduplicate 
AllsAllAll
CMake 2.8.10 
 
0013574: Ninja: no transitive dependency for imported libraries
ExternalProject_Add(x ....)
add_library(xLib STATIC IMPORTED GLOBAL)
set_target_properties(xLib PROPERTIES IMPORTED_LOCATION libx.a)
add_dependencies(xLib x)

target_link_library(y xLib)

This is broken for ninja. Ninja starts building y and stops because three is no rule for libx.a.

No tags attached.
related to 0013538closed  Ninja: Generated 'build.ninja' seems to be incomplete and fails to build ExternalProjects. 
related to 0014963closed Brad King Add explicit specification of custom command side effect outputs 
Issue History
2012-10-05 15:41Peter KuemmelNew Issue
2012-10-05 15:41Peter KuemmelStatusnew => assigned
2012-10-05 15:41Peter KuemmelAssigned To => Peter Kuemmel
2012-10-05 15:41Peter KuemmelRelationship addedrelated to 0013538
2012-10-06 10:04Brad KingNote Added: 0031191
2012-10-06 10:15Peter KuemmelDescription Updatedbug_revision_view_page.php?rev_id=849#r849
2012-10-06 10:17Peter KuemmelNote Added: 0031192
2012-10-06 10:29Peter KuemmelNote Edited: 0031192bug_revision_view_page.php?bugnote_id=31192#r851
2012-11-05 22:13Nick HutchinsonNote Added: 0031468
2012-11-06 01:43Peter KuemmelNote Added: 0031470
2012-11-12 11:04David ColeTarget Version => CMake 2.8.11
2013-05-17 09:33Robert MaynardTarget VersionCMake 2.8.11 => CMake 2.8.12
2013-09-15 10:50Nick HutchinsonNote Added: 0033827
2013-10-20 12:33Nick HutchinsonNote Added: 0034175
2013-11-26 06:06Peter KuemmelStatusassigned => confirmed
2014-04-13 05:47Peter KuemmelAssigned ToPeter Kuemmel =>
2014-06-10 17:16Tom HughesNote Added: 0036156
2014-06-11 08:36Brad KingRelationship addedrelated to 0014963
2014-06-11 08:37Brad KingNote Added: 0036157
2014-07-01 09:35Brad KingNote Added: 0036297
2014-07-01 09:35Brad KingStatusconfirmed => resolved
2014-07-01 09:35Brad KingResolutionopen => duplicate
2014-07-01 09:35Brad KingTarget VersionCMake 2.8.12 =>
2015-01-05 08:39Robert MaynardNote Added: 0037578
2015-01-05 08:39Robert MaynardStatusresolved => closed

Notes
(0031191)
Brad King   
2012-10-06 10:04   
Shouldn't the last line of the example be

 target_link_library(y xLib)

?
(0031192)
Peter Kuemmel   
2012-10-06 10:17   
(edited on: 2012-10-06 10:29)
Ah yes, this is what I've tested.

A real world example is here:
git://github.com/syntheticpp/kst.git [^]

cmake -GNinja ../kst/cmake/ -Dkst_3rdparty_build=1
ninja libkst2_fits_gaussian_unweighted.so

ninja: error: '3rdparty/installed/lib/libgsl.a', needed by 'build/lib/kst2/plugins/libkst2_fits_gaussian_unweighted.so', missing and no known rule to make it

libgsl.a is build as external project:
https://github.com/syntheticpp/kst/blob/master/cmake/3rdparty/CMakeLists.txt [^]

(0031468)
Nick Hutchinson   
2012-11-05 22:13   
I've been bitten by this. Is there a workaround, other than manually building the ExternalProject targets first?
(0031470)
Peter Kuemmel   
2012-11-06 01:43   
Have a look at the related bug 0013538.
(0033827)
Nick Hutchinson   
2013-09-15 10:50   
This issue is now trying my patience on a daily basis — if a fix is yet again going to be punted until a future release, I'd like to have a go at tackling it myself. I'm not familiar with CMake's code -- where would be the best place to start looking?
(0034175)
Nick Hutchinson   
2013-10-20 12:33   
I've opened a pull request with my initial stab at fixing this: https://github.com/Kitware/CMake/pull/68. [^] Please let me know where to take it from here.
(0036156)
Tom Hughes   
2014-06-10 17:16   
I'm also hitting this.
(0036157)
Brad King   
2014-06-11 08:37   
See discussion in 0014963.
(0036297)
Brad King   
2014-07-01 09:35   
I'm resolving this as a duplicate of issue 0014963 which describes the larger problem. Either 0014963 needs to be resolved on the CMake side, or the Ninja issue linked in 0014747:0035830 needs to be resolved on the Ninja side. That will resolve this issue.
(0037578)
Robert Maynard   
2015-01-05 08:39   
Closing resolved issues that have not been updated in more than 4 months