diff --git a/CMakeLists.txt b/CMakeLists.txt index c96f517..3e9d9f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,87 +1,96 @@ cmake_minimum_required (VERSION 3.0 FATAL_ERROR) -project(kmag) +# KDE Application Version, managed by release script +set(KDE_APPLICATIONS_VERSION_MAJOR "19") +set(KDE_APPLICATIONS_VERSION_MINOR "07") +set(KDE_APPLICATIONS_VERSION_MICRO "70") +set(KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") + +project(kmag VERSION ${KDE_APPLICATIONS_VERSION}) set(QT_MIN_VERSION "5.9.0") set(KF5_MIN_VERSION "5.46.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) include(KDEInstallDirs) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(ECMInstallIcons) include(FeatureSummary) +include(ECMSetupVersion) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Widgets PrintSupport ) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS DocTools I18n KIO XmlGui ) find_package(QAccessibilityClient 0.4 CONFIG) set_package_properties(QAccessibilityClient PROPERTIES DESCRIPTION "KDE client-side accessibility library" URL "https://commits.kde.org/libqaccessibilityclient" TYPE OPTIONAL PURPOSE "Required to enable keyboard focus tracking." ) configure_file( "${PROJECT_SOURCE_DIR}/focustrackconfig.h.in" "${PROJECT_BINARY_DIR}/focustrackconfig.h") include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) add_definitions( -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050900 -DQT_STRICT_ITERATORS ) add_subdirectory( doc ) add_subdirectory( pics ) ########### next target ############### +ecm_setup_version(${KDE_APPLICATIONS_VERSION} VARIABLE_PREFIX KMAG VERSION_HEADER kmag_version.h) + set(kmag_SRCS kmagzoomview.cpp kmagselrect.cpp kmag.cpp colorsim.cpp main.cpp ) qt5_add_resources(kmag_SRCS kmag.qrc ) add_executable(kmag ${kmag_SRCS}) target_link_libraries(kmag Qt5::Core Qt5::Widgets Qt5::PrintSupport KF5::KIOCore KF5::I18n KF5::XmlGui ) if(QAccessibilityClient_FOUND) target_link_libraries(kmag ${QACCESSIBILITYCLIENT_LIBRARY}) endif(QAccessibilityClient_FOUND) install(TARGETS kmag ${INSTALL_TARGETS_DEFAULT_ARGS} ) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) ########### install files ############### install( PROGRAMS org.kde.kmag.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) install(FILES org.kde.kmag.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) ecm_install_icons( ICONS 16-apps-kmag.png 32-apps-kmag.png DESTINATION ${ICON_INSTALL_DIR} ) diff --git a/main.cpp b/main.cpp index 1e3a598..ef37ffd 100644 --- a/main.cpp +++ b/main.cpp @@ -1,80 +1,80 @@ /*************************************************************************** main.cpp - description ------------------- begin : Mon Feb 12 23:45:41 EST 2001 copyright : (C) 2001-2003 by Sarang Lakare email : sarang#users.sf.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ // Qt #include #include // KF5 #include #include #include "kmag.h" -#include "version.h" +#include "kmag_version.h" KmagApp *kmagapp; // Not needed, not used. //static const char description[] = // I18N_NOOP("Kmag"); // INSERT A DESCRIPTION FOR YOUR APPLICATION HERE int main(int argc, char *argv[]) { QApplication app(argc, argv); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); KLocalizedString::setApplicationDomain("kmag"); // about the application - KAboutData aboutData(QStringLiteral("kmag"), i18n("KMagnifier"), QStringLiteral(KMAG_VERSION), + KAboutData aboutData(QStringLiteral("kmag"), i18n("KMagnifier"), QStringLiteral(KMAG_VERSION_STRING), i18n("Screen magnifier created by KDE"), KAboutLicense::GPL, i18n("Copyright 2001-2003 Sarang Lakare\nCopyright 2003-2004 Olaf Schmidt\nCopyright 2008 Matthew Woehlke"), QString(), QStringLiteral("https://accessibility.kde.org/")); // about the authors aboutData.addAuthor(i18n("Sarang Lakare"), i18n("Rewrite"),QStringLiteral("sarang@users.sf.net"), QStringLiteral("http://www.cs.sunysb.edu/~lsarang/linux")); aboutData.addAuthor(i18n("Michael Forster"), i18n("Original idea and author (KDE1)"), QStringLiteral("forster@fmi.uni-passau.de")); aboutData.addAuthor(i18n("Olaf Schmidt"), i18n("Rework of the user interface, improved selection window, speed optimization, rotation, bug fixes"), QStringLiteral("ojschmidt@kde.org")); aboutData.addCredit(i18n("Matthew Woehlke"), i18n("Color-blindness simulation"), QStringLiteral("mw_triad@users.sourceforge.net")); aboutData.addCredit(i18n("Sebastian Sauer"), i18n("Focus tracking"), QStringLiteral("sebsauer@kdab.com")); aboutData.addCredit(i18n("Claudiu Costin"), i18n("Some tips"), QStringLiteral("claudiuc@work.ro"), QStringLiteral("https://ro.kde.org")); KAboutData::setApplicationData(aboutData); if (app.isSessionRestored()) { RESTORE(KmagApp); } else { QCommandLineParser parser; parser.addHelpOption(); parser.addVersionOption(); parser.process(app); kmagapp = new KmagApp(); kmagapp->show(); } return app.exec(); } diff --git a/version.h b/version.h deleted file mode 100644 index cc1a9ce..0000000 --- a/version.h +++ /dev/null @@ -1,8 +0,0 @@ -// KMag Version Information -// -#ifndef kmag_version_h -#define kmag_version_h - -#define KMAG_VERSION "1.0" - -#endif /*version_h*/