qmake functions, variables, and conditions

Some qmake variables, functions, and conditions are hard to know their meanings. I list here for a memo.

$$replace(variable, old_string, new_string): replace old_string in variable with new_string.

$$unique(variable): remove duplicated items in variable(a list).

variable *= item: add item to variable(a list) if it is not already there.

variable ~= s,regex,substitution,g: for every item in variable, replace regex with substitution.[reference]

$$reverse(variable): reverse the items in variable. The items in variable is separated with spaces.

$$basename(variable): get the file name part of a full path name.

$$section(_PRO_FILE_, ., 0, 0): get the section 0 to section 0 of _PRO_FILE_ whose sections are separated with .. Note that the first parameter of $$section is a variable name, not variable value. So do not use $$section($$_PRO_FILE_, ., 0, 0). The following usage is wrong: $$section($$basename(_PRO_FILE_), ., 0, 0). Instead, you should use $$section($$list($$basename(_PRO_FILE_)), ., 0, 0), as $$list(value) return a temporary variable name for value.

$$resolve_depends(modules, “QT.”, “.depends”): return all items in modules and their dependent modules. The dependent modules of a particular module are gotten from Qt.module.depends.

 

 

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Leave a Reply