From deddefc72a90a0dbbe0b11d3e82dae8bf9afcd08 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Mon, 13 Sep 2021 12:51:14 +0800 Subject: [PATCH] update install command --- CMakeLists.txt | 5 ++++- GPClient/CMakeLists.txt | 12 ++++++++++-- GPService/CMakeLists.txt | 7 ++++++- GPService/gpservice.cpp | 2 +- GPService/gpservice.h | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ba1770..224032a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,4 +35,7 @@ add_3rdparty( ) add_subdirectory(GPService) -add_subdirectory(GPClient) \ No newline at end of file +add_subdirectory(GPClient) + +include(InstallRequiredSystemLibraries) +include(CPack) \ No newline at end of file diff --git a/GPClient/CMakeLists.txt b/GPClient/CMakeLists.txt index 024f54d..4b6268c 100644 --- a/GPClient/CMakeLists.txt +++ b/GPClient/CMakeLists.txt @@ -1,4 +1,4 @@ -project(gpclient) +project(GPClient) set(gpclient_GENERATED_SOURCES) @@ -21,6 +21,10 @@ add_executable(gpclient samlloginwindow.cpp gpclient.cpp settingsdialog.cpp + gpclient.ui + normalloginwindow.ui + settingsdialog.ui + resources.qrc ${gpclient_GENERATED_SOURCES} ) @@ -34,4 +38,8 @@ target_link_libraries(gpclient Qt5::WebEngine Qt5::WebEngineWidgets Qt5::DBus -) \ No newline at end of file +) + +install(TARGETS gpclient DESTINATION bin) +install(FILES com.yuezk.qt.gpclient.desktop DESTINATION share/applications) +install(FILES com.yuezk.qt.GPClient.svg DESTINATION share/pixmaps) \ No newline at end of file diff --git a/GPService/CMakeLists.txt b/GPService/CMakeLists.txt index 089ebb1..f00269e 100644 --- a/GPService/CMakeLists.txt +++ b/GPService/CMakeLists.txt @@ -1,4 +1,4 @@ -project(gpservice) +project(GPService) set(gpservice_GENERATED_SOURCES) @@ -27,3 +27,8 @@ target_link_libraries(gpservice Qt5::Core Qt5::DBus ) + +install(TARGETS gpservice DESTINATION ) +install(FILES "dbus/com.yuezk.qt.GPService.conf" DESTINATION "share/dbus-1/system.d" ) +install(FILES "dbus/com.yuezk.qt.GPService.service" DESTINATION "share/dbus-1/system-services") +install(FILES "systemd/gpservice.service" DESTINATION "etc/systemd/system") diff --git a/GPService/gpservice.cpp b/GPService/gpservice.cpp index 54acb44..0d5fe4e 100644 --- a/GPService/gpservice.cpp +++ b/GPService/gpservice.cpp @@ -40,7 +40,7 @@ QString GPService::findBinary() } /* Port from https://github.com/qt/qtbase/blob/11d1dcc6e263c5059f34b44d531c9ccdf7c0b1d6/src/corelib/io/qprocess.cpp#L2115 */ -QStringList GPService::splitCommand(QStringView command) +QStringList GPService::splitCommand(QString command) { QStringList args; QString tmp; diff --git a/GPService/gpservice.h b/GPService/gpservice.h index 146d032..db72f8a 100644 --- a/GPService/gpservice.h +++ b/GPService/gpservice.h @@ -55,7 +55,7 @@ private: void log(QString msg); static QString findBinary(); - static QStringList splitCommand(QStringView command); + static QStringList splitCommand(QString command); }; #endif // GLOBALPROTECTSERVICE_H