例如
#增加一个选项,WXWINDOWS_USE_SHARED_LIBS
OPTION(WXWINDOWS_USE_SHARED_LIBS "Use shared versions (.so) of wxWindows libraries" ON)
MARK_AS_ADVANCED(WXWINDOWS_USE_SHARED_LIBS)
相关知识
OPTION
: Provides an option that the user can optionally select.
OPTION(OPTION_VAR "help string describing option"
[initial value])Provide an option for the user to select as ON or OFF. If no initial value is provided, OFF is used.
MARK_AS_ADVANCED: Mark cmake cached variables as advanced.
MARK_AS_ADVANCED([CLEAR|FORCE] VAR VAR2 VAR...)
Mark the named cached variables as advanced. An advanced variable will not be displayed in any of the cmake GUIs unless the show advanced option is on. If CLEAR is the first argument advanced variables are changed back to unadvanced. If FORCE is the first argument, then the variable is made advanced. If neither FORCE nor CLEAR is specified, new values will be marked as advanced, but if the variable already has an advanced/non-advanced state, it will not be changed