From 10d20b3a73f8ec5fbb765178e6f6174f21eec2e1 Mon Sep 17 00:00:00 2001 From: Gabo Date: Fri, 29 Dec 2023 11:12:59 +0100 Subject: [PATCH] updated the README, added nstructions about how to includeqnite in a CMake project --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index ac3938f..7e34d1c 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,46 @@ cmake --build . ctest --output-on-failure ``` +## Usage + +How to include QNite in your CMake application: + +* include qnite as a CMake subdirectory + +* add qnite as your target dependency: + + ``` + target_link_libraries( + my_target + PRIVATE + ... + qnite + ) + ``` + +* in the project *main.cpp*, initialize qnite resources: + + ``` + #include + + void main() { + ... + Q_INIT_RESOURCE(qnite); + ... + } + ``` + +* add to your CMakeLists.txt the logic allowing to install qnite resources: + + ``` + get_target_property(QNITE_SOURCE_DIR qnite SOURCE_DIR) + + install( + DIRECTORY "${QNITE_SOURCE_DIR}/qml/Qnite/" + DESTINATION Qnite/ + COMPONENT + ) + ``` ## Roadmap