Hi,

this nice post (https://crascit.com/2016/01/31/enhanced-source-file-handling-with-target_sources/) mentions some modern usage of target_sources(), but also shows some discrepancy between target_link_libraries and the remaining target_* functions. In particlar, CMake does not allow linking to a target outside its creation scope whereas all the other ones do. There exists a workaround with include(), but it seems not the correct and clean way to handle this.

So I think lifting this limitation would escepially help large-scale projects and improve modularization by handling third-party dependencies in the specific modules (as long as only this particular module needs it).

So what is your experience regarding this linking restriction, especially in larger projects? I also opened an issue for this (see https://gitlab.kitware.com/cmake/cmake/issues/17943).

Best regards,
Patrick Stotko
--

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-developers

Reply via email to