Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (revision 1721) +++ CMakeLists.txt (revision 1722) @@ -1,8 +1,6 @@ -set( CMAKE_BUILD_TYPE DebugFull ) -#Warned by dev build, probably works with older than 3.7 -cmake_minimum_required( VERSION 3.16.0 ) -set (QT_MIN_VERSION "5.7.0") -set (KF5_MIN_VERSION "5.15") +# 3,20.5 is stable as of 2021-09-12 +cmake_minimum_required( VERSION 3.20.5 ) + #Warned by dev build, apparently having mixed full path and search references #causes different behavior depending on this policy, we should be fine with NEW if( COMMAND cmake_policy) @@ -11,53 +9,81 @@ project( kuroo ) -#set(CMAKE_AUTOMOC ON) -#set(CMAKE_INCLUDE_CURRENT_DIR ON) +# 5.15 is stable as of 2021-09-12 +set (QT_MIN_VERSION "5.15.2") +set (KF5_MIN_VERSION "5.85") + +set( CMAKE_BUILD_TYPE DebugFull ) + set(CMAKE_VERBOSE_MAKEFILE ON) find_package( ECM 5.85.0 REQUIRED NO_MODULE ) # increase this to get more strict compiler settings set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH}) -#set(KDE_COMPILERSETTINGS_LEVEL 5.85.0) #override version of ECM +#set(KDE_COMPILERSETTINGS_LEVEL 5.85.0) # allow to override to a lower version than ECM include(KDECompilerSettings NO_POLICY_SCOPE) #Must be first include after find_package ECM because implicitly depends on min ECM version which could be overwritten by other find_package calls -include(KDEInstallDirs) -include(KDECMakeSettings) +set( KDE_INSTALL_DIRS_NO_DEPRECATED TRUE ) +include(KDEInstallDirs) #Should be before KDECMakeSettings + +set( ENABLE_CLAZY TRUE ) +include(KDECMakeSettings NO_POLICY_SCOPE) #https://api.kde.org/ecm/kde-module/KDECMakeSettings.html include(FeatureSummary) -include(GenerateExportHeader) include(ECMInstallIcons) include(ECMAddTests) +# ECMQtDeclareLoggingCategory? -find_package(Qt5Widgets REQUIRED) +# Works without this explicit declaration but it ought to be here for correctness +find_package( SQLite3 REQUIRED ) -find_package( KF5 ${KF5_MIN_VERSION} REQUIRED - Auth - Config - ConfigWidgets - CoreAddons - I18n - IconThemes - ItemModels - ItemViews +# These are actually all deps of other things +find_package( Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS + Core + Gui + Widgets + # These must be deps of KF things, shouldn't be used directly + #Network + #Xml + #DBus +) + +find_package( KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS + # These are all required directly and not provided by any dependencies. It "compiles and works" on the development system with just these KIO Notifications ThreadWeaver TextWidgets - Su - WidgetsAddons - WindowSystem - XmlGui + # Required in link step + XmlGui # MainWindow is XmlGuiWindow + ItemViews # TreeWidgetSearchLine + # These seem to be provided by deps, but should be direct deps too + ConfigWidgets + I18n # i18n(QStr) + Config # Config dialogs + Auth # KAuthExecuteJob &c. + CoreAddons # AboutData? Job Process User? + WidgetsAddons # Font(Chooser|Requester)? PageWidget? MessageBox ... + # Also shown as toplevel deps in lddtree kuroo but don't make sense + #Sonnet + #Service + #Codecs ) # # checks for functions and stuff #Randomly borrowed from ktorrent # -include(CheckIncludeFiles) -include(CheckFunctionExists) +#include(CheckIncludeFiles) +#include(CheckSymbolExists) add_subdirectory( src ) add_subdirectory( po ) add_subdirectory( pics ) +# prints the nice summary "The following (OPTIONAL|REQUIRED|...) packages have been found feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) + +# Adds (make|ninja) clang_format command +include(KDEClangFormat) +file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) +kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) Index: src/CMakeLists.txt =================================================================== --- src/CMakeLists.txt (revision 1721) +++ src/CMakeLists.txt (revision 1722) @@ -3,14 +3,14 @@ #Singletons in common.h depend on lots of things in subdirs include_directories( -${CMAKE_SOURCE_DIR}/src -${CMAKE_SOURCE_DIR}/src/config -${CMAKE_SOURCE_DIR}/src/core -${CMAKE_SOURCE_DIR}/src/history -${CMAKE_SOURCE_DIR}/src/intro -${CMAKE_SOURCE_DIR}/src/logs -${CMAKE_SOURCE_DIR}/src/portage -${CMAKE_SOURCE_DIR}/src/queue + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/config + ${CMAKE_SOURCE_DIR}/src/core + ${CMAKE_SOURCE_DIR}/src/history + ${CMAKE_SOURCE_DIR}/src/intro + ${CMAKE_SOURCE_DIR}/src/logs + ${CMAKE_SOURCE_DIR}/src/portage + ${CMAKE_SOURCE_DIR}/src/queue ) #core @@ -102,36 +102,70 @@ ki18n_wrap_ui( kuroo_sources messagebase.ui ) add_executable(kuroo - ${core_sources} - ${history_sources} - ${portage_sources} - ${config_sources} - ${queue_sources} - ${intro_sources} - ${logs_sources} - ${kuroo_sources} ) + ${core_sources} + ${history_sources} + ${portage_sources} + ${config_sources} + ${queue_sources} + ${intro_sources} + ${logs_sources} + ${kuroo_sources} ) kde_enable_exceptions() target_link_libraries( kuroo + # These are all used directly and not provided by any other dependency. It "compiles and works" on the development system with just these + KF5::KIOCore + KF5::Notifications + KF5::ThreadWeaver + KF5::TextWidgets + KF5::XmlGui + sqlite3 # TODO: use some sort of ORM maybe find_package? + KF5::ItemViews + # Builds without these specified, but they should be necessary Qt5::Core + Qt5::Gui + Qt5::Widgets KF5::Auth + KF5::AuthCore KF5::ConfigCore KF5::ConfigGui + KF5::ConfigWidgets KF5::CoreAddons KF5::I18n - KF5::ItemViews - KF5::KIOCore - KF5::Notifications - KF5::ThreadWeaver - KF5::TextWidgets KF5::WidgetsAddons - KF5::WindowSystem - KF5::XmlGui - sqlite3 + # lddtree also shows these as top-level deps but they don't make sense + #Qt5::Xml + #KF5::Service + #KF5::SonnetUi + #Qt5::Network + #KF5::Codecs + #Qt5::DBus + #libstdc++ + #libm + #libgcc_s + #libc ) add_executable( kuroo_helper auth/kuroohelper.cpp ) -target_link_libraries( kuroo_helper Qt5::Core KF5::KIOCore KF5::Auth KF5::CoreAddons ) +target_link_libraries( kuroo_helper + # These are all used directly and not provided by any other dependency. It "compiles and works" on the development system with just these + KF5::KIOCore + KF5::Auth + # Builds without explicit declaration, but these make sense + Qt5::Core + KF5::CoreAddons # KProcess + # lddtree shows these as top-level deps but they don't make sense + #KF5::Service + #Qt5::Network + #KF5::ConfigCore + #KF5::AuthCore + #KF5::CoreAddons + #Qt5::DBus + #libstdc++ + #libm + #libgcc_s + #libc +) install( TARGETS kuroo_helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR} ) kauth_install_helper_files( kuroo_helper org.gentoo.portage.kuroo root ) kauth_install_actions( org.gentoo.portage.kuroo auth/org.gentoo.portage.kuroo.actions ) @@ -139,6 +173,6 @@ ########### install ############### install( TARGETS kuroo ${INSTALL_TARGETS_DEFAULT_ARGS} ) #install( FILES DESTINATION ${DATA_INSTALL_DIR}/autostart ) -install( FILES config/kurooconfig.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) +install( FILES config/kurooconfig.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR} ) install( FILES kurooui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kuroo ) install( FILES kuroo.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}/System )