<div dir="ltr"><div>Hi everyone, I've a question about interface sources.<br></div><div><br></div><div>If you create an interface target A, add some sources via <br></div><div><br></div><div>add_library(A INTERFACE)<br></div><div>target_sources(A INTERFACE some/relative/path)</div><div><br></div><div>then link to another library B:</div><div><br></div><div>add_library(B)<br></div><div>target_link_libraries(B PRIVATE A)</div><div><br></div><div>B will search for those sources relative to its own source directory, not the directory where A is defined. This means B fails to configure with a missing sources error if the targets are in different directories.<br></div><div><br></div><div>If I specify the paths absolutely, B successfully finds the sources. However, A can no longer be exported and neither can the static variant of B by association.<br></div><div><br></div><div>I tried using $<TARGET_PROPERTY:A,SOURCE_DIR> in front of the relative path, however it turns out SOURCE_DIR isn't a whitelisted property for INTERFACE libraries.</div><div><br></div><div>Is this behavior intentional, and if so, is there any workaround? (other than defining all targets with interface sources in the same directory as the targets that use them)</div></div>