[CMake] When should I use add_subdirectory and when ExternalProject?

Todd Greer TGreer at affinegy.com
Tue Feb 19 11:56:25 EST 2013


From one brief use of ExternalProject, I came to the conclusion that it should be used when it makes sense to let CMake handle downloading the project in question, and to otherwise use add_subdirectory. Others with more ExternalProject experience may have greater insight, though.

--
Todd Greer
Principal Scientist, Affinegy, Inc.

From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of Ansis Malinš
Sent: Monday, February 4, 2013 2:23 AM
To: cmake
Subject: [CMake] When should I use add_subdirectory and when ExternalProject?

If I have a dependency (e.g. SDL2) that seems to work with add_subdirectory just fine, should I still use ExternalProject_Add instead? Given both ways work, what should I prefer? What are the tradeoffs?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130219/7cf5f962/attachment.htm>


More information about the CMake mailing list