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

Brad King brad.king at kitware.com
Tue Mar 3 15:02:51 EST 2015


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.

Instead one could introduce a new API function for this, e.g.

 cpack_maybe_set(...)

Existing calls to cpack_set_if_not_set within CMake itself can be
ported in an immediately following patch.  The macro can be documented
as deprecated with a suggestion to use the function instead.

If you work on that, please include tests (perhaps in the form of a
new Tests/RunCMake/CPack directory), documentation updates, and a
release note in a file such as 'Help/release/dev/cpack-maybe-set.rst'.

Thanks,
-Brad



More information about the cmake-developers mailing list