[cmake-developers] ExternalProject: using the same argument multiple times

David Cole david.cole at kitware.com
Mon Jun 13 14:35:35 EDT 2011


It is unexpected (and user/pilot error, if encountered) to have
multiple INSTALL_DIR arguments to ExternalProject_Add.

Why do you have to override the function in order to achieve your goal?

Most ExternalProject arguments have reasonable default values for the
corresponding properties, and can simply be left off if they do not
need overriding. Which ones do not?

I'm pretty sure the internal details of stringing multiple COMMAND
arguments together rely on the append behavior, but it's been a while
since I had to analyze/think about that code... I'd be happy to
analyze a patch, but I'm not promising I'll be happy about changing
the low level beehavior of ExternalProject_Add unless it's pretty much
guaranteed not to break any current real-world usage of it.


Thanks,
Dave


On Mon, Jun 13, 2011 at 8:44 AM, Alexander Neundorf <neundorf at kde.org> wrote:
> Hi Dave,
>
> I want to wrap the externalproject_add() function, so that in the normal case
> only the git URL has to be specified, and all other arguments have been
> already set.
> But it should still be possible to override "my" default arguments.
>
> So I had a look how the argument parsing is done in ExternalProject.cmake
>
> When a value for a keyword is found, set_property(APPEND) is used.
> This means that if I do
>
> externalproject_add(INSTALL_DIR /opt/foo
>                    INSTALL_DIR /opt/bar )
>
> then INSTALL_DIR will be /opt/foo;/opt/bar .
>
> I'd like to change this so that the second argument will override the first
> one (I saw that this appending is also used to append the multiple arguments
> for one keyword to the property of this keyword, so I will not break this).
>
> What do you think ?
> Are there use cases where I would actually want to split my arguments into
> multiple parts and have them concatenated ?
>
> Alex
>



More information about the cmake-developers mailing list