Hi,
  As I've been learning CMake, it seems the best practice for a library is
for it to export the targets it creates. There is also the relatively new
command FetchContent. It seems that at least in part the FetchContent
command obviates the need for exporting targets.

I can see that for larger more permanent libraries exporting targets is
still preferred so the library can be installed once and used by multiple
projects on a developers workstation without having to install it on each
project.

At work we're a bunch of research engineers that happen to write a lot of
software-- exporting targets still seems cumbersome and it seems not
exporting targets and then just have users use FetchContent to pull in a
library is not a bad idea.

Are there other reasons /advantages of exporting targets?

Thanks,
Jason
-- 

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