On Thu, 2019-04-04 at 06:56 +0100, Stephan Menzel wrote:
> add_library(mylib STATIC mysources)
> add_excecutable(mytest mytest.cpp)
> target_link_libraries(mytest mylib)
> 
> 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.

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.

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.

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.

Also please let us know which version of CMake you're using.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to