diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f9c3f0..07c471f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,46 +1,53 @@ -project(blinken) - cmake_minimum_required (VERSION 3.5 FATAL_ERROR) +# 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(blinken VERSION ${KDE_APPLICATIONS_VERSION}) + # minimal Qt requirement set(QT_MIN_VERSION "5.9.0") set(KF5_MIN_VERSION "5.46.0") # ECM find_package (ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) # where to look first for cmake modules set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) find_package (Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Svg) find_package (KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n XmlGui GuiAddons DocTools DBusAddons Crash ) find_package (Phonon4Qt5 REQUIRED) include(KDEInstallDirs) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(FeatureSummary) include(ECMAddAppIcon) include(ECMInstallIcons) +include(ECMSetupVersion) # global include directories include_directories (${CMAKE_CURRENT_BINARY_DIR}) add_subdirectory( doc ) add_subdirectory( src ) add_subdirectory( images ) add_subdirectory( icons ) add_subdirectory( sounds ) add_subdirectory( fonts ) ########### install files ############### install( FILES README.packagers DESTINATION ${KDE_INSTALL_DATADIR}/blinken/ ) install( FILES org.kde.blinken.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 359283a..ba844e6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,37 +1,39 @@ ########### next target ############### +ecm_setup_version(${KDE_APPLICATIONS_VERSION} VARIABLE_PREFIX BLINKEN VERSION_HEADER blinken_version.h) + set(blinken_SRCS main.cpp blinken.cpp soundsplayer.cpp blinkengame.cpp number.cpp highscoredialog.cpp counter.cpp button.cpp ) include_directories(${PHONON_INCLUDES}) kconfig_add_kcfg_files(blinken_SRCS settings.kcfgc ) add_executable(blinken ${blinken_SRCS}) target_link_libraries(blinken KF5::I18n KF5::XmlGui KF5::GuiAddons Qt5::Svg KF5::DBusAddons KF5::Crash ${PHONON_LIBRARIES} ) install(TARGETS blinken EXPORT blinken ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} ) ########### install files ############### install( PROGRAMS org.kde.blinken.desktop DESTINATION ${KDE_INSTALL_APPDIR} ) install( FILES blinken.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR} ) diff --git a/src/main.cpp b/src/main.cpp index 14e69d2..e5a4e09 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,60 +1,62 @@ /*************************************************************************** * Copyright (C) 2005-2007 by Albert Astals Cid * * * * 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. * ***************************************************************************/ #include "blinken.h" +#include "blinken_version.h" + #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { KLocalizedString::setApplicationDomain("blinken"); QApplication app(argc, argv); - KAboutData about(QStringLiteral("blinken"), i18n("Blinken"), QStringLiteral("0.4"), i18n("A memory enhancement game"), KAboutLicense::GPL, i18n("© 2005-2007 Albert Astals Cid\n© 2005-2007 Danny Allen")); + KAboutData about(QStringLiteral("blinken"), i18n("Blinken"), QStringLiteral(BLINKEN_VERSION_STRING), i18n("A memory enhancement game"), KAboutLicense::GPL, i18n("© 2005-2007 Albert Astals Cid\n© 2005-2007 Danny Allen")); about.addAuthor(i18n("Albert Astals Cid"), i18n("Coding"), QStringLiteral("aacid@kde.org")); about.addAuthor(i18n("Danny Allen"), i18n("Design, Graphics and Sounds"), QStringLiteral("danny@dannyallen.co.uk")); about.addCredit(i18n("Steve Jordi"), i18n("GPL'ed his 'Steve' font so that we could use it"), QStringLiteral("steve@sjordi.com")); KAboutData::setApplicationData(about); KCrash::initialize(); Kdelibs4ConfigMigrator migrate(QStringLiteral("blinken")); migrate.setConfigFiles(QStringList() << QStringLiteral("blinkenrc")); migrate.migrate(); QCommandLineParser parser; about.setupCommandLine(&parser); parser.process(app); about.processCommandLine(&parser); app.setWindowIcon(QIcon::fromTheme(QStringLiteral("blinken"))); QFont f(QStringLiteral("Steve"), 12, QFont::Normal, true); // Works with Steve may need some tweaking to work with other fonts if (!QFontInfo(f).exactMatch()) { QFontDatabase::addApplicationFont(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("fonts/steve.ttf"))); } KDBusService service; new blinken(); return app.exec(); }