[CMake] String option recognized as boolean

Nils Gladitz nilsgladitz at gmail.com
Fri May 30 06:25:32 EDT 2014


On 05/30/2014 12:12 PM, David Cole wrote:
> The cache is telling you:
>
>     "//No help, variable specified on the command line."
>
> If you want the help string from your sources to appear in the
> CMakeCache.txt, then don't specify a value for it on the command line...
>
> Delete the cache, and try again without giving the arg on the command
> line, and it should pick up the doc string from the source.
>
>
> HTH,
> David C.
>

It works when you omit the type.

set(FOO "value" CACHE STRING "my docstring")

-DFOO=BAR <- the value is "BAR" but the doc string and type are 
initialized by the set()

-DFOO:STRING=BAR <- the doc string and type are not updated by the set()

Nils


More information about the CMake mailing list