On Wed, Jan 26, 2011 at 11:24:48AM -0600, kent williams wrote:
> cmake_minimum_required(VERSION 2.8)
> project(testo)
> 
> function(set_a_var var value)
>   set(${var} ${value})
>   message("${var} = ${${var}}")
> endfunction()
> 
> set_a_var(testo "HELLO!")
> 
> message("outside func testo=${testo}")

function() creates a new scope, so you need PARENT_SCOPE on the set() in
set_a_var().

tyler
_______________________________________________
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://www.cmake.org/mailman/listinfo/cmake

Reply via email to