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

Brad King brad.king at kitware.com
Tue Aug 18 10:44:34 EDT 2015


On 08/17/2015 05:13 PM, Роман Донченко wrote:
> What makes this macro a public one? It's not listed in "cmake  
> --help-module CPack", so I assumed it was an implementation detail.  

It was originally intended as an implementation detail but since it
is available in a public module, does not start in an underscore,
and is not explicitly commented as internal, I expect projects
may be using it.  The original method is left from early days when
we did not have a formal way to document such APIs.

>> 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.

I agree.  The replacement can be named "_cpack_maybe_set" and commented
as internal.  The original can be commented as deprecated and left
unused.  One could even add a message(DEPRECATION) command to the
original.

Thanks,
-Brad



More information about the cmake-developers mailing list