cmake -D <var>:<type> = <value>:<type>是什么?</type> </value> </type> </var>

时间:2013-03-21 11:48:50

标签: cmake

-D <var>:<type>=<value>:创建一个cmake缓存条目。

好的,但是<type>可以做什么?我见过BOOL,STRING,PATH,FILEPATH。那种类型还有什么?

1 个答案:

答案 0 :(得分:10)

在CMake手册页的“缓存条目属性”下:

TYPE   Widget type for entry in GUIs.

    Cache entry values are always strings, but CMake GUIs present widgets to help users set values.  The GUIs use this property as a hint to determine the widget type.  Valid TYPE values are:

            BOOL          = Boolean ON/OFF value.
            PATH          = Path to a directory.
            FILEPATH      = Path to a file.
            STRING        = Generic string value.
            INTERNAL      = Do not present in GUI at all.
            STATIC        = Value managed by CMake, do not change.
            UNINITIALIZED = Type not yet specified.

          Generally the TYPE of a cache entry should be set by the command which creates it (set, option, find_library, etc.).