On 11/8/2013 4:19 PM, Alexander Neundorf wrote:
> On Friday 08 November 2013, Daniele E. Domenichelli wrote:
>> So it looks like that "set(FOO "" PARENT_SCOPE)" instead of setting an
>> empty FOO value, unsets it in the parent scope, and the behaviour is
>> definitely different from set for the current scope.
> 
> How about adding one new policy "modify handling of empty variables" which is 
> used by both ?

At most the policy should affect PARENT_SCOPE.  One can see the
difference right in cmSetCommand, where parentScope was added:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc8ce174#patch6

For parentScope it does

    if (value.empty())
      {
      this->Makefile->RaiseScope(variable, 0);
      }
    else
      {
      this->Makefile->RaiseScope(variable, value.c_str());
      }

while for normal scope it does just

    this->Makefile->AddDefinition(variable, value.c_str());

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to