joaocandre
joaocandre

Reputation: 1745

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.

Upvotes: 0

Views: 133

Answers (1)

eerorika
eerorika

Reputation: 238321

No. CMake variables such as CMAKE_PROJECT_VERSION are not accessible to the source files.

Upvotes: 1

Related Questions