-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
129 additions
and
534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
project(TankenApp C CXX) | ||
cmake_minimum_required(VERSION 3.0.0) | ||
|
||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
||
find_package(Qt5Core) | ||
find_package(Qt5Qml) | ||
find_package(Qt5Quick) | ||
|
||
# Automatically create moc files | ||
set(CMAKE_AUTOMOC ON) | ||
|
||
# Components PATH | ||
execute_process( | ||
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH | ||
OUTPUT_VARIABLE ARCH_TRIPLET | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}") | ||
|
||
set(PROJECT_NAME "TankenApp") | ||
set(FULL_PROJECT_NAME "com.ubuntu.developer.derjasper.tankenapp") | ||
set(CMAKE_INSTALL_PREFIX /) | ||
set(DATA_DIR /) | ||
set(DESKTOP_FILE_NAME ${PROJECT_NAME}.desktop) | ||
|
||
# This command figures out the target architecture for use in the manifest file | ||
execute_process( | ||
COMMAND dpkg-architecture -qDEB_HOST_ARCH | ||
OUTPUT_VARIABLE CLICK_ARCH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) | ||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR}) | ||
install(DIRECTORY TankenApp DESTINATION ${DATA_DIR}) | ||
#install(DIRECTORY assets DESTINATION ${DATA_DIR}) | ||
|
||
# Translations | ||
file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js) | ||
list(APPEND I18N_SRC_FILES ${DESKTOP_FILE_NAME}.in.h) | ||
|
||
find_program(INTLTOOL_MERGE intltool-merge) | ||
if(NOT INTLTOOL_MERGE) | ||
message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package") | ||
endif() | ||
find_program(INTLTOOL_EXTRACT intltool-extract) | ||
if(NOT INTLTOOL_EXTRACT) | ||
message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package") | ||
endif() | ||
|
||
add_custom_target(${DESKTOP_FILE_NAME} ALL | ||
COMMENT "Merging translations into ${DESKTOP_FILE_NAME}..." | ||
COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${CMAKE_SOURCE_DIR}/${DESKTOP_FILE_NAME}.in ${DESKTOP_FILE_NAME} | ||
COMMAND sed -i 's/${PROJECT_NAME}-//g' ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} | ||
) | ||
|
||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR}) | ||
|
||
add_subdirectory(po) | ||
|
||
# Make source files visible in qtcreator | ||
file(GLOB_RECURSE PROJECT_SRC_FILES | ||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} | ||
TankenApp/**.qml | ||
TankenApp/**.js | ||
TankenApp/**.png | ||
*.json | ||
*.json.in | ||
*.apparmor | ||
*.desktop.in | ||
) | ||
|
||
add_custom_target(${PROJECT_NAME}_FILES ALL SOURCES ${PROJECT_SRC_FILES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
"networking", | ||
"location" | ||
], | ||
"policy_version": 1.3 | ||
"policy_version": 16.04 | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
{ | ||
"template": "pure-qml-qmake", | ||
"arch": "all" | ||
} | ||
|
||
"template": "pure-qml-cmake", | ||
"kill": "qmlscene" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ | |
"title": "TankenApp", | ||
"hooks": { | ||
"TankenApp": { | ||
"apparmor": "TankenApp/TankenApp.apparmor", | ||
"desktop": "TankenApp/TankenApp.desktop" | ||
"apparmor": "TankenApp.apparmor", | ||
"desktop": "TankenApp.desktop" | ||
} | ||
}, | ||
"version": "0.4.14", | ||
"maintainer": "Jasper Nalbach <[email protected]>", | ||
"framework": "ubuntu-sdk-15.04" | ||
"framework": "ubuntu-sdk-16.04" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
include(FindGettext) | ||
find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext) | ||
|
||
set(DOMAIN ${FULL_PROJECT_NAME}) | ||
set(POT_FILE ${DOMAIN}.pot) | ||
file(GLOB PO_FILES *.po) | ||
|
||
# Creates the .pot file containing the translations template | ||
add_custom_target(${POT_FILE} ALL | ||
COMMENT "Generating translation template" | ||
COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini | ||
--srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE_NAME}.in | ||
|
||
COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE} | ||
-D ${CMAKE_CURRENT_SOURCE_DIR} | ||
-D ${CMAKE_CURRENT_BINARY_DIR} | ||
--from-code=UTF-8 | ||
--c++ --qt --language=javascript --add-comments=TRANSLATORS | ||
--keyword=tr --keyword=tr:1,2 --keyword=N_ --keyword=_ | ||
--package-name='${DOMAIN}' | ||
${I18N_SRC_FILES} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
# Builds the binary translations catalog for each language | ||
# it finds source translations (*.po) for | ||
foreach(PO_FILE ${PO_FILES}) | ||
get_filename_component(LANG ${PO_FILE} NAME_WE) | ||
gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE}) | ||
set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/share/locale/${LANG}/LC_MESSAGES) | ||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo | ||
DESTINATION ${INSTALL_DIR} | ||
RENAME ${DOMAIN}.mo) | ||
endforeach(PO_FILE) |
Oops, something went wrong.