Skip to main content

option

option_enum(VARIABLE DESCRIPTION ENUM_VALUES DEFAULT **kwargs)

Create a CMake integer option that can be modified through CLI. Option defined this way will be visible in cmake-gui interface as well as SoCMake help_options() help menu. To override the variable use cmake -D<VARIABLE>=<VALUE>

Parameters

NameTypeDescription
VARIABLEstringname of the variable.
DESCRIPTIONstringshort description string for the variable
ENUM_VALUESlist[string]possible values variable can have
DEFAULTintegerdefault value of the variable
ADVANCEDbooleanoptional, mark options as advanced, it will not show in help menu

option_string(VARIABLE DESCRIPTION DEFAULT **kwargs)

Create a CMake string option that can be modified through CLI. Option defined this way will be visible in cmake-gui interface as well as SoCMake help_options() help menu. To override the variable use cmake -D<VARIABLE>=<VALUE>

Parameters

NameTypeDescription
VARIABLEstringname of the variable.
DESCRIPTIONstringshort description string for the variable
DEFAULTstringdefault value of the variable
ADVANCEDbooloptional, mark options as advanced, it will not show in help menu

option_file(VARIABLE DESCRIPTION DEFAULT **kwargs)

Create a CMake file path option that can be modified through CLI. Option defined this way will be visible in cmake-gui interface as well as SoCMake help_options() help menu. To override the variable use cmake -D<VARIABLE>=<VALUE>

Parameters

NameTypeDescription
VARIABLEstringname of the variable.
DESCRIPTIONstringshort description string for the variable
DEFAULTstringdefault value of the variable
ADVANCEDbooloptional, mark options as advanced, it will not show in help menu
CHECK_EXISTSbooloptional, check if the file path exists at the time of configuring the project, default FALSE

option_directory(VARIABLE DESCRIPTION DEFAULT **kwargs)

Create a CMake directory path option that can be modified through CLI. Option defined this way will be visible in cmake-gui interface as well as SoCMake help_options() help menu. To override the variable use cmake -D<VARIABLE>=<VALUE>

Parameters

NameTypeDescription
VARIABLEstringname of the variable.
DESCRIPTIONstringshort description string for the variable
DEFAULTstringdefault value of the variable
ADVANCEDbooloptional, mark options as advanced, it will not show in help menu
CHECK_EXISTSbooloptional, check if the directory path exists at the time of configuring the project, default FALSE

option_integer(VARIABLE DESCRIPTION DEFAULT **kwargs)

Create a CMake integer option that can be modified through CLI. Option defined this way will be visible in cmake-gui interface as well as SoCMake help_options() help menu. To override the variable use cmake -D<VARIABLE>=<VALUE>

Parameters

NameTypeDescription
VARIABLEstringname of the variable.
DESCRIPTIONstringshort description string for the variable
DEFAULTintegerdefault value of the variable
ADVANCEDbooleanoptional, mark options as advanced, it will not show in help menu

option_boolean(VARIABLE DESCRIPTION DEFAULT **kwargs)

Create a CMake boolean option that can be modified through CLI. Option defined this way will be visible in cmake-gui interface as well as SoCMake help_options() help menu. To override the variable use cmake -D<VARIABLE>=<VALUE>

Parameters

NameTypeDescription
VARIABLEstringname of the variable.
DESCRIPTIONstringshort description string for the variable
DEFAULTbooleandefault value of the variable
ADVANCEDbooleanoptional, mark options as advanced, it will not show in help menu