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

Michael Wild themiwi at gmail.com
Mon Feb 4 07:03:02 EST 2013


I don't know about Windows, but then you might have a team that shares a
common SDL build on a network drive, and then references that using the
ExternalProject feature instead of building this external dependency over
and over again.


On Mon, Feb 4, 2013 at 12:26 PM, Ansis Māliņš <ansis.malins at gmail.com>wrote:

> "SDL installation"? But there is no such thing. At least not on Windows.
> ... Right?
>
>
> On Mon, Feb 4, 2013 at 1:10 PM, Michael Wild <themiwi at gmail.com> wrote:
>
>> In that case, clearly ExternalProject_Add. It is an external dependency,
>> and should be treated as such. If a users have SDL already installed on
>> their system, they're going to hate you for shipping it AGAIN in your
>> package, possibly even wrecking their original installation of SDL. By
>> providing download information in the ExternalProject_Add call, you can
>> make things even fully automated for your user.
>>
>> Michael
>>
>>
>> On Mon, Feb 4, 2013 at 9:23 AM, Ansis Māliņš <ansis.malins at gmail.com>wrote:
>>
>>> 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?
>>>
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.cmake.org/mailman/listinfo/cmake
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130204/0e9b43b7/attachment.htm>


More information about the CMake mailing list