I\'m writing a CMakeLists.txt to generate files and compile the generated files. I create a function to add some file path strings to a global list variable.
My CMak
Another approach is to use global properties. Once you set it:
set_property(GLOBAL PROPERTY source_list_property "${source_list}")
you can read it from everywhere:
get_property(source_list GLOBAL PROPERTY source_list_property)
I used in examples above the different names for property (source_list_property) and for variable (source_list). Maybe it is better to use the same name. But point is to use a property as global variables, and not about naming.
Such global properties aren't in cache.