[CMake] How to define a global scope variable ?

Alexander Neundorf a.neundorf-work at gmx.net
Tue Jun 23 16:03:15 EDT 2009


On Tuesday 23 June 2009, Xiangyun Kong wrote:
> How could I define a global scoped variable in CMAKE, so that I could use
> something like,
>
>     set (global_name ${global_name} {files})
>
> to collect all files in each sub-catogory recursively ?
>
> It seems I could only use PARENT_SCOPE to make the parent directory
> aware of the variable.

Yes.
Or you could use a GLOBAL property.

Alex


More information about the CMake mailing list