Commit a682ef43 authored by Mladen Milinkovic's avatar Mladen Milinkovic
Browse files

App version is using ecm_setup_version.

parent 34c4b9ce
......@@ -54,14 +54,12 @@ matrix:
script:
- |-
mkdir build && cd build
ver="$(git describe --always --abbrev=8 | sed 's/-g/./;s/-/./;s/^v//g')"
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DKDE_INSTALL_LIBDIR=lib \
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
-DBUILD_TESTING=OFF \
-DAPP_VERSION="$ver" \
.. || (cat /home/travis/build/maxrd2/subtitlecomposer/build/CMakeFiles/CMakeOutput.log ; exit 1) || exit 1
make -j$(nproc) || exit 1
after_success:
......
project(subtitlecomposer)
cmake_policy(SET CMP0048 NEW)
project(subtitlecomposer VERSION "0.7.0")
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
set(QT_MIN_VERSION "5.3.0")
......@@ -21,7 +22,7 @@ include(KDECMakeSettings)
include(KDECompilerSettings)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMAddTests) # build tests
include(FeatureSummary)
......@@ -34,13 +35,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Auth Config ConfigWidgets CoreAddons I18n KIO XmlGui
Sonnet Kross Codecs TextWidgets WidgetsAddons)
if(APP_VERSION)
message(STATUS "Building as custom version ${APP_VERSION}")
set(APP_VERSION ${APP_VERSION} CACHE INTERNAL EXPORTEDVARIABLE)
else()
set(APP_VERSION 0.7.0 CACHE INTERNAL EXPORTEDVARIABLE)
endif()
add_subdirectory(po)
add_subdirectory(src)
......
......@@ -56,8 +56,7 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \
-DKDE_INSTALL_LIBDIR=lib \
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
-DBUILD_TESTING=OFF \
-DAPP_VERSION="${pkgver}"
-DBUILD_TESTING=OFF
make
}
......
......@@ -57,8 +57,7 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \
-DKDE_INSTALL_LIBDIR=lib \
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
-DBUILD_TESTING=OFF \
-DAPP_VERSION="${pkgver}"
-DBUILD_TESTING=OFF
make
}
......
......@@ -27,7 +27,6 @@ i686-w64-mingw32-cmake \
-DKF5_HOST_TOOLING=/usr/lib/cmake \
-DKCONFIGCOMPILER_PATH=/usr/lib/cmake/KF5Config/KF5ConfigCompilerTargets.cmake \
-DTARGETSFILE=/usr/lib/cmake/KF5CoreAddons/KF5CoreAddonsToolingTargets.cmake \
-DAPP_VERSION="$appver" \
..
make -j$(nproc)
make DESTDIR="$PWD/nsis" nsis
......@@ -19,6 +19,12 @@ include_directories(
${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS}
)
ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX SUBTITLECOMPOSER
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/config-subtitlecomposer.h"
)
add_definitions(${QT_DEFINITIONS} -DHAVE_CONFIG_H)
add_definitions(-D_DEFAULT_SOURCE)
......
......@@ -5,9 +5,6 @@
#define SC_INSTALL_BIN "@CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@"
#define SC_INSTALL_PLUGIN "@SC_PLUGIN_INSTALL_DIR@"
// Application version
#define APP_VERSION "@APP_VERSION@"
// Whether ICU was found
#cmakedefine HAVE_ICU
......
......@@ -36,6 +36,7 @@ extern "C" {
#include <libavformat/avformat.h>
}
#include "config-subtitlecomposer.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
......@@ -63,7 +64,7 @@ main(int argc, char **argv)
KAboutData aboutData(
QStringLiteral("subtitlecomposer"),
i18n("Subtitle Composer"),
APP_VERSION,
SUBTITLECOMPOSER_VERSION_STRING,
i18n("A KDE subtitle editor."),
KAboutLicense::GPL_V2,
QStringLiteral("&copy; 2007-2017 Subtitle Composer project"),
......@@ -81,8 +82,6 @@ main(int argc, char **argv)
aboutData.addCredit(i18n("All people who have contributed and I have forgotten to mention"));
aboutData.setDesktopFileName(QStringLiteral("subtitlecomposer"));
// register about data
KAboutData::setApplicationData(aboutData);
......
Supports Markdown
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