qt_ifcodegen_add_plugin
Adds a plugin target which is generated by ifcodegen using a qface IDL file.
The command is defined in the InterfaceFramework
component of the Qt6
package.
Load the package with:
find_package(Qt6 REQUIRED COMPONENTS InterfaceFramework)
This command was introduced in Qt 6.8.
Synopsis
qt_ifcodegen_add_plugin( target IDL_FILES idl_files TEMPLATE template [ANNOTATION_FILES ...] [IDL_IMPORT_PATH ...] [OUTPUT_DIR output_dir] [EXTRA_HEADERS_OUTPUT_DIR extra_headers_output_dir] [EXTRA_TEMPLATE_SEARCH_PATH ...] [VERBOSE] [...] # arguments supported by qt_add_plugin )
If versionless commands are disabled, use qt6_ifcodegen_add_plugin()
instead. It supports the same set of arguments as this command.
Description
Adds a plugin target which is generated by ifcodegen.
It accepts the following arguments in addition to all arguments supported by qt6_add_plugin.
The CLASS_NAME
and PLUGIN_TYPE
arguments are automatically extracted from the template file if not set explicitly.
The input IDL file is specified using IDL_FILES
, while TEMPLATE
specifies the ifcodegen template used for the generation. The given template either needs to be a path to a template folder or a name of a template found in the template search path. Using the EXTRA_TEMPLATE_SEARCH_PATH
argument, it is possible to extend the search path. This is especially useful if you want to use your own templates for the code generation. As an alternative to the function argument the QT_IFCODEGEN_TEMPLATE_SEARCH_PATH global CMake variable can be used to specify an extra search path for all ifcodegen function calls.
Additional annotation files are passed by the ANNOTATION_FILES
argument.
IDL_IMPORT_PATH
can be used to add to the search paths where IDL files that this one depends on can be found. The other IDL files still need to be generated and built on their own.
OUTPUT_DIR
specifies the directory where the generated files will be written to and defaults to CMAKE_CURRENT_BINARY_DIR
.
EXTRA_HEADER_OUTPUT_DIR
is used to provide an extra directory where all generated header files are copied to.
By default all log messages generated by ifcodegen are discarded. To show them you can use the VERBOSE
argument, set the IFCODEGEN_VERBOSE variable or use set CMAKE_MESSAGE_LOG_LEVEL
to VERBOSE
.
For more details on the generator's command line arguments, see Use the Generator.
For more details on the generator's command line arguments, see Use the Generator.
Examples
find_package(Qt6 COMPONENTS InterfaceFramework) # Generates a plugin using the backend_simulator template # and sets the MANUAL_FINALIZATION option, which is passed # directly to qt_add_plugin. qt_ifcodegen_add_plugin(addressbook_plugin IDL_FILES addressbook.qface TEMPLATE backend_simulator MANUAL_FINALIZATION )
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.