<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I've been struggling to use ninja-generator with imported libraries in CMake on Windows.  The issue started when I moved some third-party code in the project to an external project using find_package.  I have since reduced the issue to a minimally reproducible example:</div><div><br></div><div>add_library(foo STATIC IMPORTED)<br>set_property(TARGET foo PROPERTY IMPORTED_LOCATION E:/path/to/foo.lib)<br>target_link_libraries(bar foo)</div><div><br></div><div>This produces a Ninja error:</div><div><br></div><div>ninja : error : 'E:/path/to/foo.lib', needed by 'bar', missing and no known rule to make it<br></div><div><br></div><div>I should note that the path to the lib exists, and in fact, this config works on other generators, such as NMake and Unix Makefiles.</div><div><br></div><div>The issue is "fixed" upon manually editing build.ninja and removing this from the bar link target:<br></div><div><br></div><div>E$:/path/to/foo.lib</div><div><br></div><div>What's the deal?  Am I missing something?  Any help would be appreciated.<br></div><div><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><b>Brendan Heinonen</b></div><br><div><b></b></div></div></div></div></div></div></div></div>