4
0
mirror of https://github.com/QuasarApp/CMake.git synced 2025-04-29 19:24:42 +00:00

55 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2021-04-20 12:26:53 +03:00
# QtUtils module
2021-03-25 16:38:12 +03:00
2021-04-02 09:20:53 +03:00
Module provides qt utils functions
The module provides qt utils functions. This module contains some useful functions. Including provides translations functionality.
2021-03-25 16:38:12 +03:00
---
2021-04-20 12:26:53 +03:00
2021-04-02 09:20:53 +03:00
## Translation
2021-04-20 12:26:53 +03:00
2021-04-02 09:20:53 +03:00
---
2025-01-22 19:15:59 +01:00
**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)
```
2021-03-25 16:38:12 +03:00
**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.
- ts_files - This is list of the supported languages.
**updateGitVars** This macros update all GIT variable releative current cmakelist.txt.
Use This macros before read **GIT_COMMIT_HASH** and **GIT_COMMIT_COUNT** variables.
2021-09-28 13:44:58 +03:00
## CMake Variables
- The **GIT_COMMIT_COUNT** - This variable contains commits count
- The **GIT_COMMIT_HASH** - This variable contains short version of the buildet commit hash.
2021-10-05 00:33:07 +03:00
### Note
2021-10-05 00:33:07 +03:00
For update actualy value of git variables use the updateGitVars macros.