forked from commontk/CTK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New CTK_ENABLE_* build system feature.
The CTK CMake configuration now shows only high-level options representing the main features of the toolkit. All other options are marked as advanced. Some options have been renamed to include the CTK_ prefix.
- Loading branch information
1 parent
7f2c86f
commit ed4b1ad
Showing
14 changed files
with
285 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
macro(ctk_option option_prefix name doc default) | ||
option(${option_prefix}_${name} ${doc} ${default}) | ||
mark_as_advanced(${option_prefix}_${name}) | ||
list(APPEND ${option_prefix}S ${name}) | ||
set(_logical_expr ${ARGN}) | ||
if(_logical_expr AND NOT ${option_prefix}_${name}) | ||
if(${ARGN}) | ||
# Force the option to ON. This is okay since the | ||
# logical expression should contain a CTK_ENABLE_* | ||
# option value, which requires the current option to be ON. | ||
get_property(_doc_string CACHE ${option_prefix}_${name} PROPERTY HELPSTRING) | ||
set(${option_prefix}_${name} ON CACHE BOOL ${_doc_string} FORCE) | ||
message("Enabling [${option_prefix}_${name}] because of [${ARGN}]") | ||
endif() | ||
endif() | ||
endmacro() | ||
|
||
macro(ctk_lib_option name doc default) | ||
ctk_option(CTK_LIB ${name} ${doc} ${default} ${ARGN}) | ||
endmacro() | ||
|
||
macro(ctk_plugin_option name doc default) | ||
ctk_option(CTK_PLUGIN ${name} ${doc} ${default} ${ARGN}) | ||
endmacro() | ||
|
||
macro(ctk_app_option name doc default) | ||
ctk_option(CTK_APP ${name} ${doc} ${default} ${ARGN}) | ||
endmacro() | ||
|
||
macro(ctk_enable_option name doc default) | ||
option(CTK_ENABLE_${name} "${doc}" ${default}) | ||
if(DEFINED CTK_ENABLE_${name}_internal) | ||
if(${CTK_ENABLE_${name}} AND ${CTK_ENABLE_${name}_internal}) | ||
if(NOT (${ARGN})) | ||
get_property(_doc_string CACHE CTK_ENABLE_${name} PROPERTY HELPSTRING) | ||
set(CTK_ENABLE_${name} OFF CACHE BOOL ${_doc_string} FORCE) | ||
message("Full support for [${name}] disabled") | ||
endif() | ||
endif() | ||
endif() | ||
set(CTK_ENABLE_${name}_internal ${CTK_ENABLE_${name}} CACHE INTERNAL "" FORCE) | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.