CMake first parses the CMakeLists.txt files in your project called “Configuration Phase,” and then generates your build environment called “Generation Phase.”
So basically the generator expressions are for everything the generator could know:
- The name and path of the target outputs (mainly in cross-compilation and in multi-configuration environments)
- Or, as a rule, any target property that the generator evaluates to mix the compiler / linker calls
Here are examples of using generator expressions in my project:
source share