diff --git a/Docs/QtUtils.md b/Docs/QtUtils.md index d7c406a..c0f1140 100644 --- a/Docs/QtUtils.md +++ b/Docs/QtUtils.md @@ -9,6 +9,33 @@ The module provides qt utils functions. This module contains some useful functio --- +**addQML** - function - This function add QML module into target and prepare qmldir file. + +* This function add QML module into target and prepare qmldir file and qrc files. +* this function designed to prepare a static or shared library with qml components, +* that can be imported into other projects only after linked parent library. + +#### Arguments : +- nicecery arguments: + - target - it is name of the target for that will be added QML module. + - QML_DIR - it is directory with QML files. + +- optional arguments: + - VERSION - it is version of the QML module. Default value is 1.0. + - MODULE_NAME - it is name of the QML module. Default value is TARGET_NAME. For example if the target name is QEQuick3d then the module name will be QEQuick3dQML. + - PUBLIC - it is flag that indicate that the QML module will be public and afailable to using in all child libs. Default value is OFF. + +- Example: + +```cmake + addQML(QEQuick3d QML_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) + addQML(QEQuick3d QML_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src VERSION 1.0 MODULE_NAME QEQuick3d) + + # To get make qml module for your shared or static library: + addQML(${CURRENT_PROJECT} QML_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/QEQuick3d" PUBLIC) + addQML(${CURRENT_PROJECT} QML_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/QEQuick3d" VERSION 1.0 MODULE_NAME QEQuick3d PUBLIC) +``` + **prepareQM** (name sourceDir ts_files) - This function prepare translations for you projects. - name - This is a name of the translations target. - sourceDir - This is root source directory. Update will be scan this dir for prepare translations. diff --git a/QtUtils.cmake b/QtUtils.cmake index 465dae7..130f531 100644 --- a/QtUtils.cmake +++ b/QtUtils.cmake @@ -39,9 +39,15 @@ endif() # VERSION - it is version of the QML module. Default value is 1.0. # MODULE_NAME - it is name of the QML module. Default value is TARGET_NAME. # For example if the target name is QEQuick3d then the module name will be QEQuick3dQML. +# PUBLIC - it is flag that indicate that the QML module will be public and afailable to using in all child libs. Default value is OFF. + # Example: # addQML(QEQuick3d QML_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) # addQML(QEQuick3d QML_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src VERSION 1.0 MODULE_NAME QEQuick3d) +# +# To get make qml module for your shared or static library: +# addQML(${CURRENT_PROJECT} QML_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/QEQuick3d" PUBLIC) +# addQML(${CURRENT_PROJECT} QML_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/QEQuick3d" VERSION 1.0 MODULE_NAME QEQuick3d PUBLIC) function(addQML target)