[CMake] How to declare global variables

Marcel Loose loose at astron.nl
Mon Mar 23 04:24:20 EDT 2009


Hi Robert,

I ran into this issue a short while ago. You might consider using a
global property. I think that's the only option if you need a global
'variable'.

Regards,
Marcel Loose.

On Sat, 2009-03-21 at 18:32 -0500, Robert Dailey wrote:
> Currently I'm having a bit of trouble making variables defined in the
> following directory:
> 
> C:\a\b\c\d\e\CMakeLists.txt
> 
> Available to another script in a distant directory, located here:
> 
> C:\a\b\x\y\z\CMakeLists.txt
> 
> I've tried using PARENT_SCOPE, but this doesn't declare it "high"
> enough. The only possible way I've been able to make this work is by
> making it an internal cache variable. However, I do not want to
> persist the contents of the variable. Do I have any other options?
> _______________________________________________
> 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



More information about the CMake mailing list