Skip to content

Commit

Permalink
Add missing -help argument to qt-configure-module
Browse files Browse the repository at this point in the history
Now it's possible to display a configure help screen per module with
  qt-configure-module <module-source-dir> -help

Pick-to: 6.2
Fixes: QTBUG-95943
Change-Id: I7d26006246af4b38b5a2ec6deca3f45c5313afec
Reviewed-by: Alexey Edelev <[email protected]>
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
jobor committed Aug 20, 2021
1 parent 57ad532 commit 1ac947e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
3 changes: 3 additions & 0 deletions bin/qt-configure-module.bat.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ goto :eof

:print_usage
echo Usage: qt-configure-module ^<module-source-dir^> [options]
echo.
echo To display the available options for a Qt module, run
echo qt-configure-module ^<module-source-dir^> -help
goto :eof
7 changes: 6 additions & 1 deletion bin/qt-configure-module.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`

printUsage()
{
echo 'Usage: qt-configure-module <module-source-dir> [options]'
cat <<EOF
Usage: qt-configure-module <module-source-dir> [options]
To display the available options for a Qt module, run
qt-configure-module <module-source-dir> -help
EOF
}

if [ "$#" -lt 1 ]; then
Expand Down
22 changes: 22 additions & 0 deletions cmake/QtProcessConfigureArgs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ while(NOT "${configure_args}" STREQUAL "")
set(auto_detect_compiler FALSE)
elseif(arg STREQUAL "-list-features")
set(list_features TRUE)
elseif(arg MATCHES "^-h(elp)?$")
set(display_module_help TRUE)
elseif(arg STREQUAL "-write-options-for-conan")
list(POP_FRONT configure_args options_json_file)
elseif(arg STREQUAL "-skip")
Expand Down Expand Up @@ -439,6 +441,26 @@ function(qt_call_function func)
endif()
endfunction()

if(display_module_help)
message([[
Options:
-help, -h ............ Display this help screen

-feature-<feature> ... Enable <feature>
-no-feature-<feature> Disable <feature> [none]
-list-features ....... List available features. Note that some features
have dedicated command line options as well.
]])

set(help_file "${MODULE_ROOT}/config_help.txt")
if(EXISTS "${help_file}")
file(READ "${help_file}" content)
message("${content}")
endif()

return()
endif()

if(list_features)
unset(lines)
foreach(feature ${commandline_known_features})
Expand Down

0 comments on commit 1ac947e

Please sign in to comment.