How do I add a configuration variable to my CMake

2019-03-14 07:01发布

I'd like to add a variable that the user must set after clicking "Configure" in cmake-gui. Is there a way to do this?

标签: cmake
1条回答
霸刀☆藐视天下
2楼-- · 2019-03-14 07:32

Using the set command, specify CACHE parameters, e.g.

set(NAME_INCLUDE "default value" CACHE FILEPATH "description")
set(NAME_LIB "default value" CACHE FILEPATH "description")

In the GUI CMake will group all variables with the same prefix.

See the CMake documentation for set.

查看更多
登录 后发表回答