summary refs log tree commit diff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-02-23 13:40:04 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2020-02-23 13:44:05 +0100
commite96241265e31264eaa96fda34c7a69c1f1ecf6c0 (patch)
tree7a3147527b52eef15021452ee8696c27061e6131 /CMakeLists.txt
parentFix Registration (diff)
downloadnheko-e96241265e31264eaa96fda34c7a69c1f1ecf6c0.tar.xz
Use third_party singleapplication helper
This may still not raise the application correctly on some WMs, because
they don't allow disturbing the user with windows popping up. I don't
think we want to work around that.

fixes #84
fixes #113
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 66e9dcd2..b4927bc3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -292,7 +292,6 @@ set(SRC_FILES
 	src/RegisterPage.cpp
 	src/RoomInfoListItem.cpp
 	src/RoomList.cpp
-	src/RunGuard.cpp
 	src/SideBarActions.cpp
 	src/Splitter.cpp
 	src/popups/SuggestionsPopup.cpp
@@ -420,6 +419,10 @@ else()
 	find_package(Tweeny REQUIRED)
 endif()
 
+# single instance functionality
+set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
+add_subdirectory(third_party/SingleApplication-3.0.19/)
+
 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
 qt5_wrap_cpp(MOC_HEADERS
@@ -563,7 +566,8 @@ target_link_libraries(nheko PRIVATE
 	nlohmann_json::nlohmann_json
 	lmdbxx::lmdbxx
 	liblmdb::lmdb
-	tweeny)
+	tweeny
+	SingleApplication::SingleApplication)
 
 if(MSVC)
 	target_link_libraries(nheko PRIVATE ntdll)