[cmake-developers] [PATCH] install: correctly deal with paths in generator expressions in DIRECTORY

Yves Frederix yves.frederix+cmake at gmail.com
Wed Aug 31 03:41:07 EDT 2016


Hi Brad,

>> +    if (!cmSystemTools::FileIsFullPath(i->c_str())) {
>> +      *i = std::string(makefile.GetCurrentSourceDirectory()) + "/" + *i;
>
> Perhaps we should issue a diagnostic here.  In principle the caller
> should always provide a full path.  If they use a genex to do it then
> they are on their own.

I don't really mind. The reason I did it like this was mainly that the
docs for install(DIRECTORY) mention: "Directory names given as
relative paths are interpreted with respect to the current source
directory.". If we can have consistent and documented behavior without
needing to issues warning or error messages, wouldn't it be better to
do so? Additionally, the same 'fix' could also be applied to
install(FILES), which in the docs currently explicitly states that
"However, if any item begins in a generator expression it must
evaluate to a full path".

Please let me know what you decide and I'll prepare a new patch.

Thanks,
Yves


More information about the cmake-developers mailing list