From 0efcbe38c419bc409cb8aa7925a4d4e738875ef5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 24 Nov 2017 15:59:32 +0100 Subject: Set a version string --- CMakeLists.txt | 8 +++++++- applications/kube/main.cpp | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2cbde180..25dd4242 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,10 +22,16 @@ include(KDECompilerSettings) #Avoid building appstreamtest set(KDE_SKIP_TEST_SETTINGS true) include(KDECMakeSettings NO_POLICY_SCOPE) +include(ECMSetupVersion) + +ecm_setup_version(PROJECT + SOVERSION kube_VERSION_MAJOR + VERSION_HEADER kube_version.h + ) enable_testing() -include_directories(.) +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) add_subdirectory(framework) add_subdirectory(components) add_subdirectory(icons) diff --git a/applications/kube/main.cpp b/applications/kube/main.cpp index 88e44eac..0c2e5eb7 100644 --- a/applications/kube/main.cpp +++ b/applications/kube/main.cpp @@ -43,6 +43,7 @@ #include #include "framework/src/keyring.h" +#include "kube_version.h" //Print a demangled stacktrace void printStacktrace() @@ -178,11 +179,13 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); app.setApplicationName("kube"); + app.setApplicationVersion(kube_VERSION_STRING); app.setFont(QFont{"Noto Sans", app.font().pointSize(), QFont::Normal}); QCommandLineParser parser; parser.setApplicationDescription("A communication and collaboration client."); parser.addHelpOption(); + parser.addVersionOption(); parser.addOption({{"k", "keyring"}, QCoreApplication::translate("main", "To automatically unlock the keyring pass in a keyring in the form of {\"accountId\": {\"resourceId\": \"secret\", *}}"), "keyring dictionary"} -- cgit v1.2.3