[cmake-developers] [PATCH] CPack: change cpack_set_if_not_set into a function

Роман Донченко dpb at corrigendum.ru
Mon Aug 17 17:13:45 EDT 2015


Okay, so after a... brief hiatus, I'm going to tackle this again. There's  
something I don't understand, though...

Brad King <brad.king at kitware.com> писал в своём письме Tue, 03 Mar 2015  
23:02:51 +0300:
> On 03/03/2015 01:33 PM, Роман Донченко wrote:
>> Since it's currently a macro, then due to macro processing rules,  
>> special
>> characters inside the value are interpreted by the parser, which can
>> result in syntax errors or a mismatch between the given default and the
>> value the variable is actually set to.
>>
>> Remove existing local workarounds for this issue, which are no longer
>> required.
>
> Thanks.  As nice as it would be to do that, the reason it has not been
> done is that this API is exposed publicly.  Any existing calls within
> other projects would also have such workarounds and they would be broken
> by this change.

What makes this macro a public one? It's not listed in "cmake  
--help-module CPack", so I assumed it was an implementation detail.  
Moreover...

> Instead one could introduce a new API function for this, e.g.
>
>  cpack_maybe_set(...)

Even supposing that the macro is part of the API and is thus immutable, I  
don't see why its replacement should be. The operation it performs is not  
related to creating packages, so to me it seems that it should not be  
exported outside of the module.

Could you clarify this for me?

Roman.


More information about the cmake-developers mailing list