CMake Variables: Master Common Variables and Environment Variables

CMake Variables: Master Common Variables and Environment Variables

1. CMake Variable Reference and Definition (1) Use ${} to reference variables. In statements like IF, use the variable name directly without ${}. (2) Custom variables can be defined implicitly and explicitly. For example, the PROJECT command implicitly defines <projectname>_BINARY_DIR and <projectname>_SOURCE_DIR. Explicitly defining variables can be done using the SET command. For example: SET(HELLO_SRC … Read more