-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '74-ctk-enable-categories' Closes #74.
* 74-ctk-enable-categories: Support disabling CTK_BUILD_EXAMPLES based on user changes. Added utility macro which allows to completely specify the option name. Use STATUS messages for enabling hints. Don't mark QT_QMAKE_EXECUTABLE as advanced. Add CTK_ENABLE_Python_Wrapping top-level option Add ctk_option_logical_expression_to_message function ctkMacroOptionUtils - Improve the enabling message New CTK_ENABLE_* build system feature. Removed Messaging library.
- Loading branch information
Showing
23 changed files
with
349 additions
and
482 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,66 @@ | ||
|
||
function(ctk_option_logical_expression_to_message varname logical_expr) | ||
set(enabling_msg) | ||
foreach(arg ${logical_expr}) | ||
if(NOT "${${arg}}" STREQUAL "") | ||
set(value_as_int 0) | ||
if(${${arg}}) | ||
set(value_as_int 1) | ||
endif() | ||
set(enabling_msg "${enabling_msg} ${arg}:${value_as_int}") | ||
else() | ||
set(enabling_msg "${enabling_msg} ${arg}") | ||
endif() | ||
endforeach() | ||
set(${varname} ${enabling_msg} PARENT_SCOPE) | ||
endfunction() | ||
|
||
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) | ||
# Generate user-friendly message | ||
set(enabling_msg) | ||
ctk_option_logical_expression_to_message(enabling_msg "${ARGN}") | ||
message(STATUS "Enabling [${option_prefix}_${name}] because of [${enabling_msg}] evaluates to True") | ||
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_raw name doc default) | ||
option(${name} "${doc}" ${default}) | ||
if(DEFINED ${name}_internal) | ||
if(${${name}} AND ${${name}_internal}) | ||
if(NOT (${ARGN})) | ||
get_property(_doc_string CACHE ${name} PROPERTY HELPSTRING) | ||
set(${name} OFF CACHE BOOL ${_doc_string} FORCE) | ||
message("Full support for [${name}] disabled") | ||
endif() | ||
endif() | ||
endif() | ||
set(${name}_internal ${${name}} CACHE INTERNAL "" FORCE) | ||
endmacro() | ||
|
||
macro(ctk_enable_option name doc default) | ||
ctk_enable_option_raw(CTK_ENABLE_${name} ${doc} ${default} ${ARGN}) | ||
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
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.