Using submodules

qi_submodule_create

qi_submodule_create(name [NO_SOURCE_GROUP]
    [SOURCE_GROUP <source_group>]
    [SRC <src> ...]
    [DEPENDS <depends> ...]
)
Arguments:
  • name – The name of the submodule
  • NO_SOURCE_GROUP – Do not create a source_group
  • SOURCE_GROUP – By default a source_group with name is created, if sourcegroup is specified then the source_group name will be name\sourcegroup
  • SRC – The list of source to include in the submodule
  • DEPENDS – The list of dependencies

A submodule is a convenient place to store source paths, dependencies and public headers. Submodule can be added a library or a module. Submodules are directly visible in Visual Studio.

Example

System Message: WARNING/2 (/home/hudson/jobs/doc/workspace/source/qibuild/ref/cmake/api/submodule.rst, line 33)

Include file u’/home/hudson/jobs/doc/workspace/source/samples/submodule/CMakeLists.txt’ not found or reading it failed

qi_submodule_add

qi_submodule_add(name [NO_SOURCE_GROUP]
    [SOURCE_GROUP <source_group>]
    [IF <if>]
    [SRC <src> ...]
    [DEPENDS <depends> ...]
)
Arguments:
  • name – The name of the submodule
  • NO_SOURCE_GROUP – Do not create a source_group.
  • SOURCE_GROUP – By default a source_group with name is created, if sourcegroup is specified then the source_group name will be name\sourcegroup
  • IF – Condition that should be verified before adding content for example (WITH_QT)
  • SRC – The list of sources to include in the submodule
  • DEPENDS – The list of dependencies

This function is similar to qi_submodule_create but appends content to the submodule. This function can be condionnal, if you specify IF then the content will be appended to the submodule only if the flags are defined.