From 288afc44e4b8f8cdfd4b9167f8ebe7ea2aa49697 Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 9 Nov 2022 09:33:42 +0000 Subject: [PATCH] Update readme for cmake --- README.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78ff6ac..0bafa82 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,37 @@ ### How to use it -1. Build limereport.pro. It will create a limereport shared library -2. In your project connect the limereport library then in source code add: +#### QMake + +- Build limereport.pro. It will create a limereport shared library +- In your project connect the limereport library + +#### CMake + +To use in your application without installation + +There are 2 possible ways: + +- Use cmake subdirectory in your CMakeLists.txt: + +```cmake +add_subdirectory(LimeReport) +target_link_libraries(myapp PRIVATE limereport-qt${QT_VERSION_MAJOR}) +``` +- Use cmake FetchContent in your CMakeLists.txt: + +```cmake +include(FetchContent) +FetchContent_Declare( + LimeReport + GIT_REPOSITORY https://github.com/fralx/LimeReport.git + GIT_TAG sha-of-the-commit +) +FetchContent_MakeAvailable(LimeReport) +target_link_libraries(myapp PRIVATE limereport-qt${QT_VERSION_MAJOR}) +``` + +- Then in source code add: ```cpp #include "lrreportengine.h" to add report engine