diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ada925..7dd3f57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,100 +1,110 @@ -project(kblackbox) - 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 "11") +set(KDE_APPLICATIONS_VERSION_MICRO "70") +set(KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") + +project(kblackbox VERSION ${KDE_APPLICATIONS_VERSION}) + set (QT_MIN_VERSION "5.7.0") set (KF5_MIN_VERSION "5.30.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Archive CoreAddons Config Crash DocTools I18n DBusAddons TextWidgets XmlGui ) find_package(KF5KDEGames 4.9.0 REQUIRED) include(FeatureSummary) include(ECMInstallIcons) include(KDEInstallDirs) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(ECMAddAppIcon) +include(ECMSetupVersion) add_definitions( -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER ) if (${KF5Config_VERSION} STRGREATER "5.56.0") add_definitions(-DQT_NO_FOREACH) MESSAGE(STATUS "compile without foreach") endif() add_subdirectory(pics) add_subdirectory(doc) set(kblackbox_SRCS kbbballsonboard.cpp kbbgamedoc.cpp kbbgraphicsitem.cpp kbbgraphicsitemball.cpp kbbgraphicsitemballrepository.cpp kbbgraphicsitemblackbox.cpp kbbgraphicsitemborder.cpp kbbgraphicsitemcursor.cpp kbbgraphicsiteminteractioninfo.cpp kbbgraphicsitemlaser.cpp kbbgraphicsitemonbox.cpp kbbgraphicsitemray.cpp kbbgraphicsitemrayresult.cpp kbbgraphicsitemset.cpp kbbgraphicsitemtutorialmarker.cpp kbbitemwithposition.cpp kbblevelconfigurationpreview.cpp kbblevelconfigurationwidget.cpp kbbmainwindow.cpp kbbscalablegraphicwidget.cpp kbbthememanager.cpp kbbtutorial.cpp main.cpp ) +ecm_setup_version(${KDE_APPLICATIONS_VERSION} VARIABLE_PREFIX KBLACKBOX VERSION_HEADER kblackbox_version.h) + kconfig_add_kcfg_files(kblackbox_SRCS kbbprefs.kcfgc) file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-kblackbox.png") ecm_add_app_icon(kblackbox_SRCS ICONS ${ICONS_SRCS}) add_executable(kblackbox ${kblackbox_SRCS}) target_link_libraries(kblackbox Qt5::Xml KF5KDEGames KF5::XmlGui Qt5::Svg KF5::I18n KF5::Archive KF5::TextWidgets KF5::DBusAddons KF5::Crash ) install(TARGETS kblackbox ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) install(PROGRAMS org.kde.kblackbox.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(FILES org.kde.kblackbox.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) install(FILES kblackboxui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kblackbox) ecm_install_icons(ICONS 128-apps-kblackbox.png 16-apps-kblackbox.png 22-apps-kblackbox.png 32-apps-kblackbox.png 48-apps-kblackbox.png 64-apps-kblackbox.png DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/main.cpp b/main.cpp index db1f585..366d694 100644 --- a/main.cpp +++ b/main.cpp @@ -1,78 +1,79 @@ // // KBlackBox // // A simple game inspired by an emacs module // /*************************************************************************** * Copyright (c) 1999-2000, Robert Cimrman * * cimrman3@students.zcu.cz * * * * Copyright (c) 2007, Nicolas Roffet * * nicolas-kde@roffet.com * * * * * * 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. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #include #include #include #include #include #include #include "kbbmainwindow.h" +#include "kblackbox_version.h" #include int main( int argc, char **argv ) { QApplication application(argc, argv); Kdelibs4ConfigMigrator migrate(QStringLiteral("kblackbox")); migrate.setConfigFiles(QStringList() << QStringLiteral("kblackboxrc")); migrate.setUiFiles(QStringList() << QStringLiteral("kblackboxui.rc")); migrate.migrate(); KLocalizedString::setApplicationDomain("kblackbox"); - KAboutData aboutData( QStringLiteral("kblackbox"), i18n("KBlackBox"), QStringLiteral("0.5.0"), i18n("Find the balls hidden in the black box by shooting laser beams!"), KAboutLicense::GPL, i18n("(c) 2007, Nicolas Roffet\n(c) 1999-2000, Robert Cimrman")); + KAboutData aboutData( QStringLiteral("kblackbox"), i18n("KBlackBox"), QStringLiteral(KBLACKBOX_VERSION_STRING), i18n("Find the balls hidden in the black box by shooting laser beams!"), KAboutLicense::GPL, i18n("(c) 2007, Nicolas Roffet\n(c) 1999-2000, Robert Cimrman")); aboutData.addAuthor(i18n("Nicolas Roffet"),i18n("Developer of version 0.4."), QStringLiteral("nicolas-kde@roffet.com")); aboutData.addAuthor(i18n("Robert Cimrman"),i18n("Original developer"), QStringLiteral("cimrman3@students.zcu.cz")); aboutData.addCredit(i18n("Johann Ollivier Lapeyre"), i18n("Artist"), QStringLiteral("johann.ollivierlapeyre@gmail.com")); aboutData.setHomepage(QStringLiteral("http://games.kde.org/kblackbox")); QCommandLineParser parser; KAboutData::setApplicationData(aboutData); KCrash::initialize(); aboutData.setupCommandLine(&parser); parser.process(application); aboutData.processCommandLine(&parser); KDBusService service; application.setWindowIcon(QIcon::fromTheme(QStringLiteral("kblackbox"))); if (application.isSessionRestored()) kRestoreMainWindows(); else { KBBMainWindow *mainWindow = new KBBMainWindow; mainWindow->show(); } return application.exec(); }