From 81465e1eec5f469f5e95649c50d0cc0e3f68d79e Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Fri, 11 Oct 2019 16:30:11 +0300 Subject: Add CMake support (#66) * Add CMake support * Remove unused 'tr()' * Add option to specify a class for inheritance * Use modern syntax * Rework CMakeLists.txt Thanks to @akallabeth * Add CMake build rules for examples --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 0b1a355..5d60986 100644 --- a/README.md +++ b/README.md @@ -50,15 +50,27 @@ how: git submodule add git@github.com:itay-grudev/SingleApplication.git singleapplication ``` -Then include the `singleapplication.pri` file in your `.pro` project file. Also -don't forget to specify which `QCoreApplication` class your app is using if it -is not `QCoreApplication`. +**Qmake:** + +Then include the `singleapplication.pri` file in your `.pro` project file. ```qmake include(singleapplication/singleapplication.pri) DEFINES += QAPPLICATION_CLASS=QApplication ``` +**CMake:** + +Then include the subdirectory in your `CMakeLists.txt` project file. + +```cmake +set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") +add_subdirectory(src/third-party/singleapplication) +``` + +Also don't forget to specify which `QCoreApplication` class your app is using if it +is not `QCoreApplication` as in examples above. + The `Instance Started` signal ------------------------ -- cgit v1.2.1