Jump to content

CMake Port/Configure System: Difference between revisions

From Qt Wiki
Kkoehne (talk | contribs)
No edit summary
Kkoehne (talk | contribs)
No edit summary
Line 19: Line 19:
<tt>PUBLIC</tt> or <tt>PRIVATE</tt> defines whether the feature is available within the Qt module, or also in other Qt modules.
<tt>PUBLIC</tt> or <tt>PRIVATE</tt> defines whether the feature is available within the Qt module, or also in other Qt modules.


=== qt_feature_definition("<feature>" "<name>" [NEGATE] [VALUE "<value>"]) ===
=== qt_feature_definition("<feature>" "<name>" ...) ===


Makes a C++ define <tt><name></tt> available. If <tt><value></tt> is set, the define will have this as value.  
Makes a C++ define <tt><name></tt> available.
 
<code>
qt_feature_definition("<feature>" "<name>" [NEGATE] [VALUE "<value>"])
</code>
 
If <tt><value></tt> is set, the define will have this as value.  


If <tt>NEGATE</tt> is given, the define is set only if the feature is disabled. Otherwise it is set only if it is enabled.
If <tt>NEGATE</tt> is given, the define is set only if the feature is disabled. Otherwise it is set only if it is enabled.

Revision as of 13:43, 11 February 2019

This is supposed to be a reference of Qt-specific CMake functions one can use in configure.cmake files. Since the port currently is still evolving quite rapidly, things may change. The ultimate reference is the code in qtbase/cmake/.

CMake Functions

qt_feature("<feature>" ...)

Defines a feature called <feature>. Whether a feature is enabled can be then elsewhere be checked by QT_FEATURE_<name>.

qt_feature("<feature>" [PUBLIC] [PRIVATE]  
                [LABEL "<label>"] 
                [PURPOSE "<purpose>"] 
                [SECTION "<selection>"] 
                [AUTODETECT <condition>] 
                [CONDITION <condition>]
                [ENABLE <condition>]
                [DISABLE <condition>]
                [EMIT_IF <condition>])

PUBLIC or PRIVATE defines whether the feature is available within the Qt module, or also in other Qt modules.

qt_feature_definition("<feature>" "<name>" ...)

Makes a C++ define <name> available.

qt_feature_definition("<feature>" "<name>" [NEGATE] [VALUE "<value>"])
If <value> is set, the define will have this as value. 

If NEGATE is given, the define is set only if the feature is disabled. Otherwise it is set only if it is enabled.