[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs/cmake/modules
From:       Alexander Neundorf <neundorf () kde ! org>
Date:       2010-11-22 17:31:20
Message-ID: 201011221831.20930.neundorf () kde ! org
[Download RAW message or body]

On Sunday 21 November 2010, Sebastian Trueg wrote:
> SVN commit 1199385 by trueg:
>
> Unset all temp variables to not pollute the global "namespace".
>
>  M  +13 -0     NepomukAddOntologyClasses.cmake
>
>
> --- trunk/KDE/kdelibs/cmake/modules/NepomukAddOntologyClasses.cmake
> #1199384:1199385 @@ -99,4 +99,17 @@
>      # finally append the source files to the source list
>      list(APPEND ${_sources} ${_out_sources})
>    endif(NOT RCGEN)
> +
> +  # reset variable names used
> +  unset(_current_arg_type)
> +  unset(_arg)
> +  unset(_ontologies)
> +  unset(_ontofilenames)
> +  unset(_classes)
> +  unset(_visibility)
> +  unset(_fastmode)
> +  unset(_targetdir)
> +  unset(_out_headers)
> +  unset(_out_sources)
> +  unset(rcgen_result)
>  endmacro(NEPOMUK_ADD_ONTOLOGY_CLASSES)


To get the same effect, you could also try to use function()/endfunction(), 
which automatically limits the scope of the variables.
If you need to set a variable outside the function, you have to use
set(... PARENT_SCOPE) then.

Alex
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic