diff --git a/CMakeLists.txt b/CMakeLists.txt index 64c7928..212ad29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,62 +1,31 @@ project(index) cmake_minimum_required(VERSION 3.0) -find_package(ECM 1.7.0 REQUIRED NO_MODULE) +set(REQUIRED_QT_VERSION 5.10.0) +set(REQUIRED_KF5_VERSION 5.60) + +find_package(ECM ${REQUIRED_KF5_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH}) option(MAUIKIT_STYLE "If set to true then the icons and styled is packaged as well") option(IS_APPIMAGE_PACKAGE "If set to true then the KF5 libraries are linked") -find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Sql Svg QuickControls2 Widgets) +find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Qml Quick Sql Svg QuickControls2 Widgets) +find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS I18n Notifications KIO Attica) + +if(ANDROID) + find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS AndroidExtras) +endif() + +find_package(MauiKit REQUIRED) + include(KDEInstallDirs) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(ECMInstallIcons) include(FeatureSummary) include(ECMAddAppIcon) -find_package(MauiKit REQUIRED) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -add_executable(index - src/index_assets.qrc - src/main.cpp - src/index.cpp - src/qml.qrc - ) - -if(MAUIKIT_STYLE) - target_compile_definitions(index PUBLIC MAUIKIT_STYLE) -endif() - find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Service Attica SyntaxHighlighting) - -if (ANDROID) - find_package(Qt5 REQUIRED COMPONENTS AndroidExtras WebView) - - target_link_libraries(index Qt5::AndroidExtras) - kde_source_files_enable_exceptions(index src/index.cpp) -else() - - find_package(Qt5 REQUIRED COMPONENTS WebEngine) - - if(IS_APPIMAGE_PACKAGE) - target_link_libraries(index KF5::KIOWidgets KF5::KIOFileWidgets KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::KIOWidgets KF5::I18n KF5::Service KF5::Attica KF5::SyntaxHighlighting) - endif() - -endif() - -target_link_libraries(index MauiKit Qt5::Sql Qt5::Quick Qt5::Qml Qt5::Widgets Qt5::Svg) - -install(TARGETS index ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES org.kde.index.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) - -#TODO: port to ecm_install_icons() -install(FILES src/assets/index.svg DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps) -# install(FILES org.kde.index.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) +add_subdirectory(src) -feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/org.kde.index.desktop b/org.kde.index.desktop deleted file mode 100755 index 8d6577d..0000000 --- a/org.kde.index.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Name=Index -Comment=File manager -TryExec=index -Exec=index %U -Terminal=false -Type=Application -Categories=Qt;KDE;System;FileTools;FileManager; -GenericName=File Manager -StartupNotify=true -Icon=system-file-manager -MimeType=inode/directory; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..c06c33d --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,29 @@ +add_executable(index + index_assets.qrc + main.cpp + index.cpp + qml.qrc +) + +if(IS_APPIMAGE_PACKAGE) + target_compile_definitions(index PUBLIC APPIMAGE_PACKAGE) +endif() + +if(MAUIKIT_STYLE) + target_compile_definitions(index PUBLIC MAUIKIT_STYLE) +endif() + +if (ANDROID) + target_link_libraries(index Qt5::AndroidExtras) + kde_source_files_enable_exceptions(index index.cpp) +endif() + +target_link_libraries(index MauiKit Qt5::Sql Qt5::Quick Qt5::Qml Qt5::Widgets Qt5::Svg) + +install(TARGETS index ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) +install(FILES org.kde.index.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) + +#TODO: port to ecm_install_icons() +install(FILES assets/index.svg DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps) +# install(FILES org.kde.index.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) + diff --git a/src/org.kde.index.desktop b/src/org.kde.index.desktop new file mode 100755 index 0000000..bcfbfac --- /dev/null +++ b/src/org.kde.index.desktop @@ -0,0 +1,36 @@ +[Desktop Entry] +Name=Index +Name[ca]=Índex +Name[es]=Índice +Name[nl]=Index +Name[pt]=Índice +Name[sk]=Index +Name[uk]=Індекс +Name[x-test]=xxIndexxx +Name[zh_TW]=索引 +Comment=File manager +Comment[ca]=Gestor de fitxers +Comment[es]=Gestor de archivos +Comment[nl]=Bestandsbeheerder +Comment[pt]=Gestor de ficheiros +Comment[sk]=Správca súborov +Comment[uk]=Менеджер файлів +Comment[x-test]=xxFile managerxx +Comment[zh_TW]=檔案管理工具 +TryExec=index +Exec=index %U +Terminal=false +Type=Application +Categories=Qt;KDE;System;FileTools;FileManager; +GenericName=File Manager +GenericName[ca]=Gestor de fitxers +GenericName[es]=Gestor de archivos +GenericName[nl]=Bestandsbeheerder +GenericName[pt]=Gestor de Ficheiros +GenericName[sk]=Správca súborov +GenericName[uk]=Менеджер файлів +GenericName[x-test]=xxFile Managerxx +GenericName[zh_TW]=檔案管理工具 +StartupNotify=true +Icon=system-file-manager +MimeType=inode/directory;