diff --git a/CMakeLists.txt b/CMakeLists.txt index 370bafe6..3434ab2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,40 @@ project(systemsettings) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) +set(QT_MIN_VERSION "5.2.0") + +set(SYSTEMSETTINGS_VERSION 4.9.97) +set(SYSTEMSETTINGS_STRING_VERSION "${SYSTEMSETTINGS_VERSION}") + remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS) -# IF(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") -# -# FIND_PACKAGE(KDE4 REQUIRED) -# INCLUDE(KDE4Defaults) -# ADD_DEFINITIONS(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -# -# ENDIF(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") +find_package(ECM 0.0.11 REQUIRED NO_MODULE) +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) + +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDECompilerSettings) + +find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS + Widgets +) -# INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR}/core ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES}) +find_package(KF5 CONFIG REQUIRED COMPONENTS + ItemViews + KCMUtils + I18n + KIO + Service + IconThemes + WindowSystem + XmlGui + DBusAddons + Config + KHtml + KDE4Support +) add_subdirectory(core) add_subdirectory(app) add_subdirectory(categories) add_subdirectory(classic) add_subdirectory(icons) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 1be3f25f..50aa29ec 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,33 +1,34 @@ include_directories( ToolTips ) set( systemsettings_SRCS SystemSettingsApp.cpp SettingsBase.cpp ToolTips/ktooltip.cpp ToolTips/ktooltipwindow.cpp ToolTips/tooltipmanager.cpp main.cpp ) kde4_add_app_icon( systemsettings_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/categories/preferences-system.png" ) kde4_add_ui_files( systemsettings_SRCS configDialog.ui ) kconfig_add_kcfg_files( systemsettings_SRCS BaseConfig.kcfgc ) qt5_add_dbus_adaptor( systemsettings_SRCS org.kde.systemsettings.xml SystemSettingsApp.h SystemSettingsApp ) add_executable( systemsettings ${systemsettings_SRCS}) +target_compile_definitions(systemsettings PRIVATE -DSYSTEMSETTINGS_STRING_VERSION="${SYSTEMSETTINGS_STRING_VERSION}") target_link_libraries( systemsettings systemsettingsview KF5::ItemViews KF5::KCMUtils KF5::I18n KF5::IconThemes KF5::KIOWidgets KF5::Service KF5::WindowSystem KF5::XmlGui KF5::DBusAddons ) install( TARGETS systemsettings ${INSTALL_TARGETS_DEFAULT_ARGS} ) install( FILES systemsettingsui.rc systemsettings.kcfg DESTINATION ${DATA_INSTALL_DIR}/systemsettings ) install( PROGRAMS kdesystemsettings.desktop systemsettings.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) diff --git a/app/main.cpp b/app/main.cpp index bd4fcb55..a961f7ba 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -1,55 +1,54 @@ /** * Copyright (C) 2009 Ben Cooksley * * This file was sourced from the System Settings package * Copyright (C) 2005 Benjamin C Meyer * * * 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 library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include #include -#include #include "SystemSettingsApp.h" #include "SettingsBase.h" #include int main( int argc, char *argv[] ) { SystemSettingsApp application(argc, argv); // About data - KAboutData aboutData("systemsettings", 0, i18n("System Settings"), WORKSPACE_VERSION_STRING, i18n("Central configuration center for KDE."), KAboutData::License_GPL, i18n("(c) 2009, Ben Cooksley")); + KAboutData aboutData("systemsettings", 0, i18n("System Settings"), SYSTEMSETTINGS_STRING_VERSION, i18n("Central configuration center for KDE."), KAboutData::License_GPL, i18n("(c) 2009, Ben Cooksley")); aboutData.addAuthor(i18n("Ben Cooksley"), i18n("Maintainer"), "bcooksley@kde.org"); aboutData.addAuthor(i18n("Mathias Soeken"), i18n("Developer"), "msoeken@informatik.uni-bremen.de"); aboutData.addAuthor(i18n("Will Stephenson"), i18n("Internal module representation, internal module model"), "wstephenson@kde.org"); KAboutData::setApplicationData(aboutData); aboutData.setProgramIconName("preferences-system"); QCommandLineParser parser; parser.addHelpOption(); parser.addVersionOption(); aboutData.setupCommandLine(&parser); parser.process(application); aboutData.processCommandLine(&parser); SettingsBase *mainWindow = new SettingsBase(); mainWindow->show(); application.setMainWindow(mainWindow); return application.exec(); }