summaryrefslogtreecommitdiffstats
path: root/qmake/doc/src/qmake-manual.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/doc/src/qmake-manual.qdoc')
-rw-r--r--qmake/doc/src/qmake-manual.qdoc166
1 files changed, 143 insertions, 23 deletions
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 7135948832..c1979c4bec 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -657,7 +657,7 @@
qmake knows about many of these features, which can be accessed via specific
variables that only take effect on the platforms where they are relevant.
- \section1 \macos and iOS
+ \section1 \macos, iOS, tvOS, and watchOS
Features specific to these platforms include support for creating universal
binaries, frameworks and bundles.
@@ -1439,7 +1439,7 @@
\target QMAKE_BUNDLE_DATA
\section1 QMAKE_BUNDLE_DATA
- \note This variable is used on \macos and iOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
Specifies the data that will be installed with a library
bundle, and is often used to specify a collection of header files.
@@ -1461,7 +1461,7 @@
\section1 QMAKE_BUNDLE_EXTENSION
- \note This variable is used on \macos and iOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
Specifies the extension to be used for library bundles.
This allows frameworks to be created with custom extensions instead of the
@@ -1695,7 +1695,7 @@
\section1 QMAKE_FRAMEWORK_BUNDLE_NAME
- \note This variable is used on \macos and iOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
In a framework project, this variable contains the name to be used for the
framework that is built.
@@ -1709,11 +1709,11 @@
\target QMAKE_FRAMEWORK_VERSION
\section1 QMAKE_FRAMEWORK_VERSION
- \note This variable is used on \macos and iOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
- For projects where the build target is a \macos or an iOS framework, this variable
- is used to specify the version number that will be applied to the framework
- that is built.
+ For projects where the build target is an \macos, iOS, tvOS, or watchOS framework, this
+ variable is used to specify the version number that will be applied to the
+ framework that is built.
By default, this variable contains the same value as the \l{#VERSION}{VERSION}
variable.
@@ -1804,10 +1804,10 @@
\target QMAKE_INFO_PLIST
\section1 QMAKE_INFO_PLIST
- \note This variable is used on \macos and iOS platforms only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS platforms only.
Specifies the name of the property list file, \c{.plist}, you
- would like to include in your \macos and iOS application bundle.
+ would like to include in your \macos, iOS, tvOS, and watchOS application bundle.
In the \c{.plist} file, you can define some variables, e.g., @EXECUTABLE@,
which qmake will replace with the actual executable name. Other variables
@@ -2164,8 +2164,8 @@
If defined, the value of this variable is used as a path to be prepended to
the built shared library's \c SONAME identifier. The \c SONAME is the
identifier that the dynamic linker will later use to reference the library.
- In general this reference may be a library name or full library path. On OS
- X and iOS, the path may be specified relatively using the following
+ In general this reference may be a library name or full library path. On \macos,
+ iOS, tvOS, and watchOS, the path may be specified relatively using the following
placeholders:
\table
@@ -2861,6 +2861,7 @@
MY_VAR2 will contain '-Lone -Ltwo -Lthree -Lfour -Lfive', and MY_VAR3 will
contain 'three two three'.
+ \target fn_first
\section2 first(variablename)
Returns the first value of \c variablename.
@@ -2869,8 +2870,9 @@
\snippet code/doc_src_qmake-manual.pro 161
- See also \l{last(variablename)}{last()}.
+ See also \l{take_first()}, \l{fn_last}{last()}.
+ \target format_number()
\section2 format_number(number[, options...])
Returns \c number in the format specified by \c options. You can specify the
@@ -2917,6 +2919,7 @@
to empty strings. If you need to encode spaces in \c glue, \c before, or \c
after, you must quote them.
+ \target fn_last
\section2 last(variablename)
Returns the last value of \c variablename.
@@ -2925,7 +2928,7 @@
\snippet code/doc_src_qmake-manual.pro 162
- See also \l{first(variablename)}{first()}.
+ See also \l{take_last()}, \l{fn_first}{first()}.
\section2 list(arg1 [, arg2 ..., argn])
@@ -2946,14 +2949,56 @@
See also \l{upper(arg1 [, arg2 ..., argn])}{upper()}.
- \section2 member(variablename, position)
+ \target member()
+ \section2 member(variablename [, start [, end]])
- Returns the value at the given \c position in the list of items in
- \c variablename.
- If an item cannot be found at the position specified, an empty string is
- returned. \c variablename is the only required field. If not specified,
- \c position defaults to 0, causing the first value in the list to be
- returned.
+ Returns the slice of the list value of \c variablename with the
+ zero-based element indices between \c start and \c end (inclusive).
+
+ If \c start is not given, it defaults to zero. This usage is
+ equivalent to \c $$first(variablename).
+
+ If \c end is not given, it defaults to \c start. This usage represents
+ simple array indexing, as exactly one element will be returned.
+
+ It is also possible to specify start and end in a single argument, with
+ the numbers separated by two periods.
+
+ Negative numbers represent indices starting from the end of the list,
+ with -1 being the last element.
+
+ If either index is out of range, an empty list is returned.
+
+ If \c end is smaller than \c start, the elements are returned
+ in reverse order.
+
+ \note The fact that the end index is inclusive and unordered implies
+ that an empty list will be returned only when an index is invalid
+ (which is implied by the input variable being empty).
+
+ See also \l{str_member()}.
+
+ \target num_add()
+ \section2 num_add(arg1 [, arg2 ..., argn])
+
+ Takes an arbitrary number of numeric arguments and adds them up,
+ returning the sum.
+
+ Subtraction is implicitly supported due to the possibility to simply
+ prepend a minus sign to a numeric value to negate it:
+
+ \code
+ sum = $$num_add($$first, -$$second)
+ \endcode
+
+ If the operand may be already negative, another step is necessary to
+ normalize the number:
+
+ \code
+ second_neg = -$$second
+ second_neg ~= s/^--//
+ sum = $$num_add($$first, $$second_neg)
+ \endcode
\section2 prompt(question)
@@ -3033,14 +3078,25 @@
See also \l{system_quote(arg)}{system_quote()}.
+ \target fn_size
\section2 size(variablename)
Returns the number of values of \c variablename.
+ See also \l{str_size()}.
+
\section2 sort_depends(variablename, prefix)
This is an internal function that you will typically not need.
+ \section2 sorted(variablename)
+
+ Returns the list of values in \c variablename with entries sorted
+ in ascending ASCII order.
+
+ Numerical sorting can be accomplished by zero-padding the values to
+ a fixed length with the help of the \l{format_number()} function.
+
\section2 split(variablename, separator)
Splits the value of \c variablename into separate values, and returns them
@@ -3050,7 +3106,46 @@
\snippet code/doc_src_qmake-manual.pro 168
- \section2 system(command[, mode])
+ \target str_member()
+ \section2 str_member(arg [, start [, end]])
+
+ This function is identical to \l{member()}, except that it operates
+ on a string value instead of a list variable, and consequently the
+ indices refer to character positions.
+
+ This function can be used to implement many common string slicing
+ operations:
+
+ \code
+ # $$left(VAR, len)
+ left = $$str_member(VAR, 0, $$num_add($$len, -1))
+
+ # $$right(VAR, len)
+ right = $$str_member(VAR, -$$num, -1)
+
+ # $$mid(VAR, off, len)
+ mid = $$str_member(VAR, $$off, $$num_add($$off, $$len, -1))
+
+ # $$mid(VAR, off)
+ mid = $$str_member(VAR, $$off, -1)
+
+ # $$reverse(VAR)
+ reverse = $$str_member(VAR, -1, 0)
+ \endcode
+
+ \note In these implementations, a zero \c len argument needs to be
+ handled separately.
+
+ See also \l{member()}, \l{num_add()}.
+
+ \target str_size()
+ \section2 str_size(arg)
+
+ Returns the number of characters in the argument.
+
+ See also \l{fn_size}{size()}.
+
+ \section2 system(command[, mode[, stsvar]])
You can use this variant of the \c system function to obtain stdout from the
command and assign it to a variable.
@@ -3059,6 +3154,11 @@
\snippet code/doc_src_qmake-manual.pro 72
+ If you pass \c stsvar, the command's exit status will be stored in that
+ variable. If the command crashes, the status will be -1, otherwise a
+ non-negative exit code of the command's choosing. Usually, comparing
+ the status with zero (success) is sufficient.
+
See also the test variant of \l{system(command)}{system()}.
\section2 system_path(path)
@@ -3077,6 +3177,26 @@
See also \l{shell_quote(arg)}{shell_quote()}.
+ \target take_first()
+ \section2 take_first(variablename)
+
+ Returns the first value of \c variablename and removes it from the
+ source variable.
+
+ This provides convenience for implementing queues, for example.
+
+ See also \l{take_last()}, \l{fn_first}{first()}.
+
+ \target take_last()
+ \section2 take_last(variablename)
+
+ Returns the last value of \c variablename and removes it from the
+ source variable.
+
+ This provides convenience for implementing stacks, for example.
+
+ See also \l{take_first()}, \l{fn_last}{last()}.
+
\target unique
\section2 unique(variablename)
@@ -4315,7 +4435,7 @@
\li nmake
\li Visual Studio projects (VS 2008 and later)
\endlist
- \li \macos and iOS
+ \li \macos, iOS, tvOS, and watchOS
\list
\li Makefile
\li Xcode