Commit b212d0c7 authored by Linus Jahn's avatar Linus Jahn

Make Kaidan version configurable from CMake

AndroidManifest and click manifest are now changed, when the version is
changed in CMake.
parent d96291ec
......@@ -10,6 +10,13 @@ endif()
project(kaidan)
set(APPLICATION_ID "im.kaidan.kaidan")
set(APPLICATION_NAME "kaidan")
set(APPLICATION_DISPLAY_NAME "Kaidan")
if(UBUNTU_TOUCH)
set(APPLICATION_NAME "${APPLICATION_ID}")
endif()
set(VERSION_STRING "0.4.0-dev")
set(DEVELOPMENT_BUILD TRUE)
# CMake options
option(I18N "Enable i18n support" FALSE)
......@@ -26,7 +33,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(AUTOMOC_MOC_OPTIONS -Muri=im.kaidan.kaidan)
set(AUTOMOC_MOC_OPTIONS -Muri=${APPLICATION_ID})
#
# Dependecies
......@@ -54,7 +61,7 @@ if(QUICK_COMPILER)
find_package(Qt5QuickCompiler)
set_package_properties(Qt5QuickCompiler PROPERTIES
DESCRIPTION "Compile QML at build time"
TYPE OPTIONAL
TYPE OPTIONAL
)
endif()
......@@ -319,6 +326,10 @@ endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE
DEBUG_SOURCE_PATH="${CMAKE_SOURCE_DIR}"
VERSION_STRING="${VERSION_STRING}"
APPLICATION_ID="${APPLICATION_ID}"
APPLICATION_NAME="${APPLICATION_NAME}"
APPLICATION_DISPLAY_NAME="${APPLICATION_DISPLAY_NAME}"
${KAIDAN_COMPILE_DEFINITIONS}
)
......@@ -326,7 +337,17 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
# Install Kaidan
#
if(ANDROID)
configure_file(${CMAKE_SOURCE_DIR}/misc/android/AndroidManifest.xml.in
${CMAKE_SOURCE_DIR}/misc/android/AndroidManifest.xml)
endif()
if(UBUNTU_TOUCH AND CLICK_ARCH)
set(CLICK_VERSION ${VERSION_STRING})
if(DEVELOPMENT_BUILD)
set(CLICK_VERSION "${CLICK_VERSION}.${CLICK_DATE}")
endif()
# will replace ${CLICK_ARCH} with its value
configure_file(${CMAKE_SOURCE_DIR}/misc/ubuntu-touch/manifest.json.in
${CMAKE_SOURCE_DIR}/misc/ubuntu-touch/manifest.json)
......
<?xml version="1.0"?>
<manifest package="org.kaidanim.kaidan" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.4.0-dev" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Kaidan" android:icon="@mipmap/icon">
<manifest package="@APPLICATION_ID@" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="@VERSION_STRING@" android:versionCode="1" 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">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
......@@ -75,7 +75,4 @@
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
<!-- %%INSERT_FEATURES -->
</manifest>
......@@ -10,6 +10,6 @@
"apparmor": "apparmor.json"
}
},
"version": "0.4.0~dev.@CLICK_DATE@",
"version": "@CLICK_VERSION@",
"maintainer": "Kaidan developers <gamerbude@lnj.li>"
}
......@@ -31,18 +31,8 @@
#ifndef GLOBALS_H
#define GLOBALS_H
/**
* Application information
*/
#define APPLICATION_ID "im.kaidan.kaidan"
#ifdef UBUNTU_TOUCH
#define APPLICATION_NAME "im.kaidan.kaidan"
#else
#define APPLICATION_NAME "kaidan"
#endif
#define APPLICATION_DISPLAY_NAME "Kaidan"
// Application information
#define APPLICATION_DESCRIPTION "A simple, user-friendly Jabber/XMPP client"
#define VERSION_STRING "0.4.0-dev"
// Kaidan settings
#define KAIDAN_SETTINGS_AUTH_JID "auth/jid"
......
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