diff --git a/CMakeLists.txt b/CMakeLists.txt index 02b063d..7132d68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,36 +1,48 @@ cmake_minimum_required(VERSION 3.0) -set(KF5_VERSION "5.47.0") # handled by release scripts -set(KF5_DEP_VERSION "5.47.0") # handled by release scripts +set(KF5_VERSION "5.47.0") # Handled by release scripts. +set(KF5_DEP_VERSION "5.47.0") # Handled by release scripts. project(foodrescue-app VERSION ${KF5_VERSION}) set(REQUIRED_QT_VERSION 5.8.0) -SET(CMAKE_CXX_STANDARD 11) - -################# Disallow in-source build ################# +set(CMAKE_CXX_STANDARD 11) +# Do not allow in-source builds. if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") message(FATAL_ERROR "foodrescue-app requires an out of source build. Please create a separate build directory and run 'cmake path_to_kirigami [options]' there.") endif() -# Make CPack available to easy generate binary packages +# Make CPack available to easily generate binary packages. include(CPack) include(FeatureSummary) -find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui Svg QuickControls2) +# Find the Qt installation. +find_package( + Qt5 ${REQUIRED_QT_VERSION} + REQUIRED + NO_MODULE + COMPONENTS Core Quick Gui Svg QuickControls2 +) set(CMAKE_AUTOMOC ON) set(AUTOMOC_MOC_OPTIONS -Muri=org.kde.kirigami) set(CMAKE_INCLUDE_CURRENT_DIR ON) -################# set KDE specific information ################# +# +# Set KDE specific CMake configuration. +# find_package(ECM 5.47.0 NO_MODULE) -set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") +set_package_properties( + ECM PROPERTIES + TYPE REQUIRED + DESCRIPTION "Extra CMake Modules." + URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules" +) -# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +# Where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) include(KDEInstallDirs) @@ -39,11 +51,14 @@ include(KDECompilerSettings NO_POLICY_SCOPE) include(ECMPoQmTools) include(ECMQMLModules) +# +# Set misc CMake configuration. +# + if(CMAKE_SYSTEM_NAME STREQUAL "Android") find_package(Qt5AndroidExtras ${REQUIRED_QT_VERSION} REQUIRED) endif() - ecm_find_qmlmodule(QtGraphicalEffects 1.0) add_definitions(-DQT_NO_URL_CAST_FROM_STRING) @@ -54,5 +69,8 @@ if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ecm_install_po_files_as_qm(po) endif() -feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) - +feature_summary( + WHAT ALL + INCLUDE_QUIET_PACKAGES + FATAL_ON_MISSING_REQUIRED_PACKAGES +) diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..f54e129 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +# The MIT License (MIT) + +Copyright © `2020` `Matthias Ansorg` + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4725e0a --- /dev/null +++ b/README.md @@ -0,0 +1,121 @@ +# Food Rescue App + + +**Table of Contents** + +**[1. Overview](#1-overview)** + +**[2. Repository Structure](#2-repository-structure)** + +**[3. Installation](#3-installation)** + +**[4. Usage](#4-usage)** + +**[5. Development Guide](#5-development-guide)** + + * [5.1. Development Setup](#51-development-setup) + * [5.2. Build and Development Process](#52-build-and-development-process) + * [5.3. Software Design](#53-software-design) + * [5.4. Code Style Guide](#54-code-style-guide) + * [5.5. Documentation Style Guide](#55-documentation-style-guide) + +**[6. License and Credits](#6-license-and-credits)** + +------ + + +## 1. Overview + +This repository contains an open source application to help assess if food is still edible or not. The actual content shown inside this application is contained and processed in repository [foodrescue-content](https://github.com/fairdirect/foodrescue-content). + +**Features:** + +* **Convergent.** The application runs from the same codebase and with the same user interface as a native (!) application on both phones, tablets and desktop computers. This is made possible by Qt5 and, based on that, the [KDE Kirigami](https://kde.org/products/kirigami/) framework. + +* **Cross-platform.** The application is cross-platform, running on all platforms supported by the KDE Kirigami framework. As of 2020-06, these are: Android, iOS, Windows, Mac OS X, Linux. + +* **Scan to check.** To quickly find the required information about a food item, scan its GTIN barcode with the camera of your device. + +**Documentation:** + +* **Project website.** The project's website with introductory information and relevant links is [fairdirect.org/food-rescue-app](https://fairdirect.org/food-rescue-app). + +* **API documentation.** The project's C++ source files contain in-code documentation that you can compile into full API docs with [Doxygen](https://www.doxygen.nl/). + +* **Other documentation.** Extensive project documentation about planned features, used technologies, frequent tasks and related projects and initiatives is available in a [Dynalist document](https://dynalist.io/d/To5BNup9nYdPq7QQ3KlYa-mA). The same content is also available as an exported version under `doc/doc.html` in this repository. But the export is still rough and does not support proper navigation in the document, so at this time the Dynalist live document is preferable. + + +## 2. Repository Structure + +TODO + + +## 3. Installation + +Right now, you would have to compile the software yourself from source ☹️ + +Eventually you will be able to install the software comfortably as follows: + +* **For Android.** Install directly from [F-Droid](https://f-droid.org/) or [Google Play](https://play.google.com/store/apps). Or install from the [KDE Android F-Droid repository](https://community.kde.org/Android/FDroid), which also contains all other Kirigami based Android applications. + +* **For iOS.** Install from the Apple App Store. + +* **For Linux.** Install from a Debian package provided in a PPA package repository. + +* **For Windows.** Download a self-extracting installer and install from there. + +* **For Mac OS X.** Download a DMG package and install from there. + + +## 4. Usage + +TODO + + +## 5. Development Guide + +### 5.1. Development Setup + +TODO + + +### 5.2. Build and Development Process + +TODO + + +### 5.3. Software Design + +TODO + + +### 5.4. Code Style Guide + +The guiding idea is to write code that reads almost like natural language. That affects variable and method naming, source code layout and also choice of the logical flow and distributing algorithmic complexity so that one can understand everything while reading through once. + +For C++ code, this means specifically: + +TODO + +And for QML code, this means specifically: + +TODO + + +### 5.5. Documentation Style Guide + +TODO + + +## 6. License and Credits + +**Licenses.** This repository exclusively contains material under free software licencses and open content licenses. Unless otherwise noted in a specific file, all files are licensed under the MIT license. A copy of the license text is provided in [LICENSE.md](https://github.com/fairdirect/foodrescue-app/blob/master/LICENSE.md). + + +**Credits.** Within the rights granted by the applicable licenses, this repository contains works of the following open source projects, authors or groups, which are hereby credited for their contributions and for holding the copyright to their contributions: + +* **[Open Food Facts](https://openfoodfacts.org/).** This project relies heavily on the groundwork done by the open source [Open Food Facts](https://openfoodfacts.org/) project for creating a data commons for food products identified by a GTIN barcode. Actual content from Open Food Facts is included only via the [foodrescue-content](https://github.com/fairdirect/foodrescue-content) repository; see there for licencing details. + +* **[IQAndreas/markdown-licenses](https://github.com/IQAndreas/markdown-licenses).** Provides orginal open source licenses in Markdown format. The `LICENSE.md` file uses one of them. + +* **[Qt](https://qt.io/) and [KDE Kirigami](https://kde.org/products/kirigami/) developers.** For making the best convergent application development framework to date. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1095268..1dba0e1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -65,7 +65,8 @@ else() message(WARNING "Could not find command kpackagetool5. Appstream information won't be generated for ${component}.") endif() -# Define the name of the executable. +# Define the name of the executable and its required inputs. +# (This will appear as a list "[hammer] exec name" in the Qt Creator project view.) add_executable(foodrescue ${foodrescue_SRCS} ${RESOURCES}) # Link all required libraries with the executable.