Verified Commit 8628ee5b authored by Linus Jahn's avatar Linus Jahn

cmake: Readd VERSION_STRING generation, Move APPLICATION_DESCRIPTION into CMake

parent c62881d3
Pipeline #12200 passed with stages
in 22 minutes and 45 seconds
cmake_minimum_required(VERSION 3.3)
find_package(ECM 5.40.0 REQUIRED NO_MODULE)
set(CMAKE_CXX_STANDARD 14)
set(QT_MIN_VERSION "5.10.0")
......@@ -9,15 +8,31 @@ endif()
project(kaidan)
# application information
set(APPLICATION_ID "im.kaidan.kaidan")
set(APPLICATION_NAME "kaidan")
set(APPLICATION_DISPLAY_NAME "Kaidan")
set(APPLICATION_DESCRIPTION "A simple, user-friendly Jabber/XMPP client for every device!")
if(UBUNTU_TOUCH)
set(APPLICATION_NAME "${APPLICATION_ID}")
endif()
set(VERSION_STRING "0.5.0-dev")
# Version
set(VERSION_MAJOR 0)
set(VERSION_MINOR 5)
set(VERSION_PATCH 0)
set(VERSION_CODE 6)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
set(DEVELOPMENT_BUILD TRUE)
set(APPLICATION_VERSION_CODE 6)
if(DEVELOPMENT_BUILD)
set(VERSION_EXTRA "${VERSION_EXTRA}-dev")
endif()
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
if(VERSION_EXTRA)
set(VERSION_STRING ${VERSION_STRING}${VERSION_EXTRA})
endif()
# CMake options
option(I18N "Enable i18n support" FALSE)
......@@ -43,6 +58,8 @@ set(AUTOMOC_MOC_OPTIONS -Muri=${APPLICATION_ID})
# Dependecies
#
find_package(ECM 5.40.0 REQUIRED NO_MODULE)
# CMake module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
......@@ -311,15 +328,15 @@ if(APPLE)
endif()
endif()
#
# Global C++ variables
#
# iOS-specific linker flags
if(IOS)
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-Wl,-e,_qt_main_wrapper -u _qt_registerPlatformPlugin")
endif()
#
# Global C++ variables
#
if(UBUNTU_TOUCH)
set(KAIDAN_COMPILE_DEFINITIONS UBUNTU_TOUCH=True)
elseif(APPIMAGE)
......@@ -342,6 +359,8 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
APPLICATION_ID="${APPLICATION_ID}"
APPLICATION_NAME="${APPLICATION_NAME}"
APPLICATION_DISPLAY_NAME="${APPLICATION_DISPLAY_NAME}"
APPLICATION_DESCRIPTION="${APPLICATION_DESCRIPTION}"
${KAIDAN_COMPILE_DEFINITIONS}
)
......@@ -405,7 +424,7 @@ elseif(UNIX AND NOT APPLE)
# install metainfo
install(FILES "misc/metadata.xml"
DESTINATION "${KDE_INSTALL_METAINFODIR}"
RENAME "im.kaidan.kaidan.appdata.xml"
RENAME "${APPLICATION_ID}.appdata.xml"
)
endif()
......
......@@ -45,9 +45,8 @@
1. Check correct functionality of all release builds
1. [Update license information](license.md)
1. In *CMakeLists.txt*:
1. Change `set(VERSION_STRING "X.Y.Z-dev")` to `set(VERSION_STRING "X.Y.Z")`
1. Change `set(DEVELOPMENT_BUILD TRUE)` to `set(DEVELOPMENT_BUILD FALSE)`
1. Change `set(APPLICATION_VERSION_CODE N)` to `set(APPLICATION_VERSION_CODE N+1)`
1. Set `DEVELOPMENT_BUILD` to `FALSE`
1. Increase `VERSION_CODE` by one
1. `git add CMakeLists.txt`
1. Update changelog (*changelog.md*):
1. Set release date
......@@ -75,13 +74,13 @@
1. `git checkout master`
1. `git merge stable`
1. Start new development version:
* **X.Y.Z, X.Y+1 and N+1 must be adjusted to correspond to the actual version.**
* **X.Y.Z must be adjusted to correspond to the actual version.**
1. In *CMakeLists.txt*:
1. Change `set(VERSION_STRING "X.Y.Z")` to `set(VERSION_STRING "X.Y+1.0-dev")`
1. Change `set(DEVELOPMENT_BUILD FALSE)` to `set(DEVELOPMENT_BUILD TRUE)`
1. Change `set(ANDROID_VERSION_CODE N)` to `set(ANDROID_VERSION_CODE N+1)`
1. Increase `VERSION_MINOR` by one and reset `VERSION_PATCH` to 0
1. Set `DEVELOPMENT_BUILD` to `TRUE` again
1. Increase `VERSION_CODE` by one
1. `git add CMakeLists.txt`
1. `git commit -m "Continue with Kaidan vX.Y+1.0-dev"`
1. `git commit -m "Continue with Kaidan vX.Y.Z-dev"`
1. `git push origin master`
### In Repository **https://invent.kde.org/websites/kaidan-im.git**
......
<?xml version="1.0"?>
<manifest package="@APPLICATION_ID@" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="@VERSION_STRING@" android:versionCode="@APPLICATION_VERSION_CODE@" android:installLocation="auto">
<manifest package="@APPLICATION_ID@" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="@VERSION_STRING@" android:versionCode="@VERSION_CODE@" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@APPLICATION_DISPLAY_NAME@" android:icon="@mipmap/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="Kaidan" android:screenOrientation="unspecified" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="@APPLICATION_DISPLAY_NAME@" android:screenOrientation="unspecified" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
......@@ -11,7 +11,7 @@
<!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ -->
<!-- Application arguments -->
<meta-data android:name="android.app.lib_name" android:value="kaidan"/>
<meta-data android:name="android.app.lib_name" android:value="@APPLICATION_NAME@"/>
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
<meta-data android:name="android.app.repository" android:value="default"/>
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
......
{
"name": "im.kaidan.kaidan",
"description": "A simple and user-friendly Jabber/XMPP client for every device",
"name": "@APPLICATION_ID@",
"description": "@APPLICATION_DESCRIPTION@",
"architecture": "@CLICK_ARCH@",
"title": "Kaidan",
"title": "@APPLICATION_DISPLAY_NAME@",
"framework": "ubuntu-sdk-16.04",
"hooks": {
"kaidan": {
......
......@@ -31,9 +31,6 @@
#ifndef GLOBALS_H
#define GLOBALS_H
// Application information
#define APPLICATION_DESCRIPTION "A simple, user-friendly Jabber/XMPP client"
// Kaidan settings
#define KAIDAN_SETTINGS_AUTH_JID "auth/jid"
#define KAIDAN_SETTINGS_AUTH_RESOURCE "auth/resource"
......
......@@ -50,7 +50,6 @@
#include "AvatarFileStorage.h"
#include "EmojiModel.h"
#include "Enums.h"
#include "Globals.h"
#include "Kaidan.h"
#include "Message.h"
#include "MessageModel.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment