On Tue, Mar 31, 2009 at 04:47:23PM -0400, Lezz Giles wrote:
> What I want to do is pass values up from src/CMakeLists.txt and 
> tst/CMakeLists.txt that can be used in the custom_command.  A normal variable 
> doesn't work - the value is scoped to the current CMakeLists.txt file.  I can 
> define the values in the project CMakeLists.txt, but then that separates them 
> from where they really should be, i.e. src|tst/CMakeLists.txt.

Look at the PARENT_SCOPE argument to set():

If PARENT_SCOPE is present, the variable will be set in the scope above
the current scope. Each new directory or function creates a new scope.
This command will set the value of a variable into the parent directory
or calling function (whichever is applicable to the case at hand) If
VALUE is not specified then the variable is removed from the parent
scope.


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