forked from mirror/nheko
parent
247539cb5a
commit
fe45c49e56
@ -1,6 +1,40 @@ |
|||||||
Changelog |
Changelog |
||||||
========= |
========= |
||||||
|
|
||||||
|
If by accident I have forgotten to credit someone in the CHANGELOG, email me and I will fix it. |
||||||
|
|
||||||
|
__3.1.3.1__ |
||||||
|
--------- |
||||||
|
* CMake build system improvements |
||||||
|
* Fixed Clang Tidy warnings |
||||||
|
|
||||||
|
_Hennadii Chernyshchyk_ |
||||||
|
|
||||||
|
__3.1.3__ |
||||||
|
--------- |
||||||
|
* Improved `CMakeLists.txt` |
||||||
|
|
||||||
|
_Hennadii Chernyshchyk_ |
||||||
|
|
||||||
|
__3.1.2__ |
||||||
|
--------- |
||||||
|
|
||||||
|
* Fix a crash when exiting an application on Android and iOS |
||||||
|
|
||||||
|
_Emeric Grange_ |
||||||
|
|
||||||
|
__3.1.1a__ |
||||||
|
---------- |
||||||
|
|
||||||
|
* Added currentUser() method that returns the user the current instance is running as. |
||||||
|
|
||||||
|
_Leander Schulten_ |
||||||
|
|
||||||
|
__3.1.0a__ |
||||||
|
---------- |
||||||
|
|
||||||
|
* Added primaryUser() method that returns the user the primary instance is running as. |
||||||
|
|
||||||
__3.0.19__ |
__3.0.19__ |
||||||
---------- |
---------- |
||||||
|
|
@ -1,45 +1,34 @@ |
|||||||
cmake_minimum_required(VERSION 3.1.0) |
cmake_minimum_required(VERSION 3.7.0) |
||||||
|
|
||||||
project(SingleApplication) |
project(SingleApplication LANGUAGES CXX) |
||||||
|
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
|
||||||
set(CMAKE_AUTOMOC ON) |
set(CMAKE_AUTOMOC ON) |
||||||
|
|
||||||
# SingleApplication base class |
|
||||||
set(QAPPLICATION_CLASS QCoreApplication CACHE STRING "Inheritance class for SingleApplication") |
|
||||||
set_property(CACHE QAPPLICATION_CLASS PROPERTY STRINGS QApplication QGuiApplication QCoreApplication) |
|
||||||
|
|
||||||
# Libary target |
|
||||||
add_library(${PROJECT_NAME} STATIC |
add_library(${PROJECT_NAME} STATIC |
||||||
singleapplication.cpp |
singleapplication.cpp |
||||||
singleapplication_p.cpp |
singleapplication_p.cpp |
||||||
) |
) |
||||||
|
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) |
||||||
|
|
||||||
# Find dependencies |
# Find dependencies |
||||||
find_package(Qt5Network) |
find_package(Qt5 COMPONENTS Network REQUIRED) |
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Network) |
||||||
|
|
||||||
if(QAPPLICATION_CLASS STREQUAL QApplication) |
if(QAPPLICATION_CLASS STREQUAL QApplication) |
||||||
find_package(Qt5 COMPONENTS Widgets REQUIRED) |
find_package(Qt5 COMPONENTS Widgets REQUIRED) |
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Widgets) |
||||||
elseif(QAPPLICATION_CLASS STREQUAL QGuiApplication) |
elseif(QAPPLICATION_CLASS STREQUAL QGuiApplication) |
||||||
find_package(Qt5 COMPONENTS Gui REQUIRED) |
find_package(Qt5 COMPONENTS Gui REQUIRED) |
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Gui) |
||||||
else() |
else() |
||||||
|
set(QAPPLICATION_CLASS QCoreApplication) |
||||||
find_package(Qt5 COMPONENTS Core REQUIRED) |
find_package(Qt5 COMPONENTS Core REQUIRED) |
||||||
endif() |
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core) |
||||||
target_compile_definitions(${PROJECT_NAME} PUBLIC QAPPLICATION_CLASS=${QAPPLICATION_CLASS}) |
|
||||||
|
|
||||||
# Link dependencies |
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Network) |
|
||||||
if(QAPPLICATION_CLASS STREQUAL QApplication) |
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Widgets) |
|
||||||
elseif(QAPPLICATION_CLASS STREQUAL QGuiApplication) |
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Gui) |
|
||||||
else() |
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core) |
|
||||||
endif() |
endif() |
||||||
|
|
||||||
if(WIN32) |
if(WIN32) |
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE advapi32) |
target_link_libraries(${PROJECT_NAME} PRIVATE advapi32) |
||||||
endif() |
endif() |
||||||
|
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PUBLIC QAPPLICATION_CLASS=${QAPPLICATION_CLASS}) |
||||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) |
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) |
||||||
|
|
||||||
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) |
|
@ -1,6 +1,6 @@ |
|||||||
The MIT License (MIT) |
The MIT License (MIT) |
||||||
|
|
||||||
Copyright (c) Itay Grudev 2015 - 2016 |
Copyright (c) Itay Grudev 2015 - 2020 |
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||||
of this software and associated documentation files (the "Software"), to deal |
of this software and associated documentation files (the "Software"), to deal |
@ -0,0 +1 @@ |
|||||||
|
#include "singleapplication.h" |
@ -0,0 +1,20 @@ |
|||||||
|
QT += core network |
||||||
|
CONFIG += c++11 |
||||||
|
|
||||||
|
HEADERS += $$PWD/SingleApplication \ |
||||||
|
$$PWD/singleapplication.h \ |
||||||
|
$$PWD/singleapplication_p.h |
||||||
|
SOURCES += $$PWD/singleapplication.cpp \ |
||||||
|
$$PWD/singleapplication_p.cpp |
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD |
||||||
|
|
||||||
|
win32 { |
||||||
|
msvc:LIBS += Advapi32.lib |
||||||
|
gcc:LIBS += -ladvapi32 |
||||||
|
} |
||||||
|
|
||||||
|
DISTFILES += \ |
||||||
|
$$PWD/README.md \ |
||||||
|
$$PWD/CHANGELOG.md \ |
||||||
|
$$PWD/Windows.md |
Loading…
Reference in new issue