3.6. Variables¶
There are only two kinds of languages: the ones people complain about andthe ones nobody uses.
We have touched already some simple syntax like dereferencing variable A
by
${A}
in message
command: message("This is A: ${A}")
. Cache variables
was mentioned in CMake stages. Here is an
overview of different types of variables with examples.
CMake documentation
Examples on GitHub
- 3.6.1. Regular variables
- 3.6.1.1. Regular vs cache
- 3.6.1.2. Scope of variable
- 3.6.1.3. New scope
- 3.6.1.4. Same scope
- 3.6.1.5. Parent scope
- 3.6.1.6. From cache
- 3.6.1.7. Cache unset regular
- 3.6.1.8. Confusing
- 3.6.1.9. Names
- 3.6.1.10. Quotes
- 3.6.1.11. Dereferencing
- 3.6.1.12. Nested dereferencing
- 3.6.1.13. Types of variable
- 3.6.1.14. Create list
- 3.6.1.15. Operations with list
- 3.6.1.16. List with one empty element
- 3.6.1.17. Recommendation
- 3.6.1.18. Summary
- 3.6.2. Cache variables
- 3.6.3. Environment variables