From 1070ffce533a216e65ce547c3816e3f2f15d95ae Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Tue, 23 May 2017 16:05:35 +0100 Subject: [PATCH] Simplify version number handling --- CMakeLists.txt | 3 +++ src/gui/CMakeLists.txt | 2 -- src/gui/src/AboutDialog.cpp | 8 +------- src/lib/common/Version.cpp | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8619128..1970c7c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,9 @@ endif() set (SYNERGY_VERSION "${SYNERGY_VERSION_MAJOR}.${SYNERGY_VERSION_MINOR}.${SYNERGY_VERSION_PATCH}") set (SYNERGY_VERSION_STRING "${SYNERGY_VERSION}-${SYNERGY_VERSION_TAG}") + +add_definitions (-DSYNERGY_VERSION="${SYNERGY_VERSION}") +add_definitions (-DSYNERGY_VERSION_STRING="${SYNERGY_VERSION_STRING}") message (STATUS "Full Synergy version string is " ${SYNERGY_VERSION_STRING}) # TODO: Find out why we need these, and remove them diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index afb80c07..6781cf31 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -33,8 +33,6 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif() qt5_use_modules (synergy Core Widgets Network) -target_compile_definitions (synergy PRIVATE -DSYNERGY_VERSION_STAGE="${SYNERGY_VERSION_STAGE}") -target_compile_definitions (synergy PRIVATE -DSYNERGY_REVISION="${SYNERGY_REVISION}") if (WIN32) target_link_libraries (synergy ${DNSSD_LIB}) diff --git a/src/gui/src/AboutDialog.cpp b/src/gui/src/AboutDialog.cpp index e86e707c..73d046a3 100644 --- a/src/gui/src/AboutDialog.cpp +++ b/src/gui/src/AboutDialog.cpp @@ -28,13 +28,7 @@ AboutDialog::AboutDialog(QWidget* parent, const QString& synergyApp) : setupUi(this); m_versionChecker.setApp(synergyApp); - QString version = m_versionChecker.getVersion(); - version = version + '-' + SYNERGY_VERSION_STAGE; -#ifdef SYNERGY_REVISION - version += '-'; - version += SYNERGY_REVISION; -#endif - m_pLabelSynergyVersion->setText(version); + m_pLabelSynergyVersion->setText(SYNERGY_VERSION_STRING); QString buildDateString = QString::fromLocal8Bit(__DATE__).simplified(); QDate buildDate = QLocale("en_US").toDate(buildDateString, "MMM d yyyy"); diff --git a/src/lib/common/Version.cpp b/src/lib/common/Version.cpp index d6449067..390ff7ab 100644 --- a/src/lib/common/Version.cpp +++ b/src/lib/common/Version.cpp @@ -25,4 +25,4 @@ const char* kCopyright = "Copyright (C) 2012-2016 Symless Ltd.\n" const char* kContact = "Email: engineering@symless.com"; const char* kWebsite = "https://symless.com/"; const char* kVersion = SYNERGY_VERSION; -const char* kAppVersion = "Synergy " SYNERGY_VERSION; +const char* kAppVersion = "Synergy " SYNERGY_VERSION_STRING;