'Are CMake macros/definitions accessible from source files?

Are the default CMake macros/definitions exposed to the source files being build?

For instance, can I access CMAKE_PROJECT_VERSION from a main.cpp?

I understand I can just force them into the source files by creating a new macro with set() and add_compile_definitions(), but was looking for a cleaner / less redundant way of achieving this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source