How do I add a configuration variable to my CMake script?

后端 未结 1 800
挽巷
挽巷 2021-02-05 00:41

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?

相关标签:
1条回答
  • 2021-02-05 01:06

    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.

    0 讨论(0)
提交回复
热议问题