<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div>On Thu, 2019-04-04 at 06:56 +0100, Stephan Menzel wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>add_library(mylib STATIC mysources)</div><div>add_excecutable(mytest mytest.cpp)</div><div>target_link_libraries(mytest mylib)</div><div><br></div><div>Now although I don't understand the exact reasons behind that, over the years came to accept that depedencies between the lib and the resulting artifcats are not working. Like, when I change a source file to mylib, the lib will get rebuilt but the resulting test tool won't be relinked.</div></blockquote><div><br></div><div>This is definitely not true, as stated. I feel like I must be missing something about your stated environment because this is really basic, fundamental CMake behavior, which has always worked.</div><div><br></div><div>If in your environment you are not seeing executables rebuilt when libraries they depend on are updated, then there is something more complex about it than the straightforward case you provide above.</div><div><br></div><div>Rather than try to find a workaround it would be better to find the root cause. If you can provide a sample setup that behaves as you describe perhaps we could explain what's happening.</div><div><br></div><div>Also please let us know which version of CMake you're using.</div></body></html>