cmake-variables manual contains the following sections:
- Variables that Provide Information
- Variables that Change Behavior
- Variables that Describe the System
- Variables that Control the Build
- Variables for Languages
- Variables for CTest
- Variables for CPack
- Variable Expansion Operators
- Internal Variables
I was looking at the first five and it can be difficult to know which section some variables belong in. There seems to be duplication, or at least considerable overlap. It also seems a bit arbitrary where some variables have ended up.
- What is the difference between Variables that Provide Information and Variables that Describe the System? Conceptually, they are both providing information.
- Are Variables that Provide Information expected to be read-only? If not, then that would imply they are meant for the user to provide information to CMake, but that would then overlap with Variables that Control the Build.
- There are language-specific variables in the Variables that Provide Information section. Why are those not in the Variables for Languages section?
I’m sure there was a clear rationale for the separate groupings at one point, but I think now they are in need of a rethink. Can we come up with a simpler grouping system? I’d then recommend we add a brief paragraph at the start of each section which explains what that group covers so that it stays organised going forward.
PS: I got to this point after working on a feature that relates to
CMAKE_NETRC_FILE, only to find that the latter two were in a different section to the first one and I couldn’t come up with a justification for that. The docs for
CMAKE_TLS_CAINFO appear to be missing altogether, but I’ll follow that up separately.