Looking at CMake documentation for the command line options, there's some ambiguity in the -D
option used to define a variable.
In the command line synopsis there's
-D<var>=<value>
While in the option description we read:
-D <var>:<type>=<value>
The two entries differ by a space between -D
and the variable definition, and by the presence/absence of :<type>
.
Does the space make any difference? What is the difference between specifying or not the type? Is it cached in any case?
From a quick test, it seems the space is optional. While if the variable type is not specified, the variable goes in CMakeCache.txt
as:
//No help, variable specified on the command line.
MYVARIABLENAME:UNINITIALIZED=MYVARIABLEVALUE
And it will not appear in the cache of cmake-gui.
Are these behaviours documented anywhere?
Edit:
I have reported an issue in CMake bug tracker. As visible in the link, it seems that some solution was already on its way, and documentation should be fixed for CMake 3.3!.