Commit 0872b62b authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

make command line parsing more compliant with configure script


- generic --* options are defined to be booleans, without the
  possibility of having an additional parameter
- -qt and -system options don't exist in the --* form
- --foo=bar options exist only in the --* form

Task-number: QTBUG-55610
Change-Id: Ib0480ac6f479df48045c9de8e854a525862ee363
Reviewed-by: default avatarLars Knoll <lars.knoll@qt.io>
Showing with 13 additions and 10 deletions
......@@ -46,7 +46,7 @@ Conventions for the remaining options: When an option's description is
followed by a list of values in brackets, the interpretation is as follows:
'yes' represents the bare option; all other values are possible prefixes to
the option, e.g., -no-gui. Alternatively, the value can be assigned, e.g.,
-gui=yes. Values are listed in the order they are tried if not specified;
--gui=yes. Values are listed in the order they are tried if not specified;
'auto' is a shorthand for 'yes/no'. Solitary 'yes' and 'no' represent binary
options without auto-detection.
......
......@@ -245,17 +245,20 @@ defineTest(qtConfParseCommandLine) {
} else: contains(c, "^--?(disable|no)-(.*)") {
opt = $$replace(c, "^--?(disable|no)-(.*)", "\\2")
val = no
} else: contains(c, "^--?qt-(.*)") {
opt = $$replace(c, "^--?qt-(.*)", "\\1")
} else: contains(c, "^--([^=]+)=(.*)") {
opt = $$replace(c, "^--?([^=]+)=(.*)", "\\1")
val = $$replace(c, "^--?([^=]+)=(.*)", "\\2")
} else: contains(c, "^--(.*)") {
opt = $$replace(c, "^--(.*)", "\\1")
val = yes
} else: contains(c, "^-qt-(.*)") {
opt = $$replace(c, "^-qt-(.*)", "\\1")
val = qt
} else: contains(c, "^--?system-(.*)") {
opt = $$replace(c, "^--?system-(.*)", "\\1")
} else: contains(c, "^-system-(.*)") {
opt = $$replace(c, "^-system-(.*)", "\\1")
val = system
} else: contains(c, "^--?([^-].*)=(.*)") {
opt = $$replace(c, "^--?([^-].*)=(.*)", "\\1")
val = $$replace(c, "^--?([^-].*)=(.*)", "\\2")
} else: contains(c, "^--?([^-].*)") {
opt = $$replace(c, "^--?([^-].*)", "\\1")
} else: contains(c, "^-(.*)") {
opt = $$replace(c, "^-(.*)", "\\1")
val =
} else {
qtConfAddError("Invalid command line parameter '$$c'.")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment