ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #05433
[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-cmake-refactor into lp:ubuntu-docviewer-app/reboot
Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-cmake-refactor into lp:ubuntu-docviewer-app/reboot.
Commit message:
Changes to the project structure and Debian packaging
Requested reviews:
Ubuntu Document Viewer Developers (ubuntu-docviewer-dev)
For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/reboot-cmake-refactor/+merge/275186
Changes to the project structure and Debian packaging
--
Your team Ubuntu Document Viewer Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-cmake-refactor into lp:ubuntu-docviewer-app/reboot.
=== modified file '.bzrignore'
--- .bzrignore 2014-10-28 22:10:16 +0000
+++ .bzrignore 2015-10-21 13:25:07 +0000
@@ -5,7 +5,6 @@
launcher/build-docviewer-launcher-Desktop-Debug/
launcher/build-docviewer-launcher-Desktop-Release/
launcher/src/docviewer-launcher.pro.user
-*.cmake
CMakeFiles
*_automoc.cpp
moc_*
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-06-24 20:50:40 +0000
+++ CMakeLists.txt 2015-10-21 13:25:07 +0000
@@ -1,34 +1,23 @@
project(com.ubuntu.docviewer C CXX)
cmake_minimum_required(VERSION 2.8.9)
-find_program(INTLTOOL_MERGE intltool-merge)
-if(NOT INTLTOOL_MERGE)
- message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package")
-endif(NOT INTLTOOL_MERGE)
-
-find_program(INTLTOOL_EXTRACT intltool-extract)
-if(NOT INTLTOOL_EXTRACT)
- message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")
-endif(NOT INTLTOOL_EXTRACT)
-
+set(UBUNTU_MANIFEST_PATH "click/manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra -fPIC")
include(FindPkgConfig)
-# Standard install paths
include(GNUInstallDirs)
-option(INSTALL_TESTS "Install the tests on make install" on)
-option(CLICK_MODE "Installs to a contained location" on)
+option(INSTALL_TESTS "Install the tests on make install" on)
+option(CLICK_MODE "Installs to a contained location" on)
-set(APP_NAME ubuntu-docviewer-app)
-set(DESKTOP_FILE "${PROJECT_NAME}.desktop")
-set(URLS_FILE "${PROJECT_NAME}.url-dispatcher")
-set(LP_PROJECT ubuntu-docviewer-app)
-set(ICON_FILE docviewer@xxxxxx)
-set(AUTOPILOT_DIR ubuntu_docviewer_app)
-set(EXEC "${APP_NAME}")
-set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
+set(APP_NAME ubuntu-docviewer-app)
+set(DESKTOP_FILE "${PROJECT_NAME}.desktop")
+set(URLS_FILE "${PROJECT_NAME}.url-dispatcher")
+set(LP_PROJECT ubuntu-docviewer-app)
+set(ICON_FILE docviewer@xxxxxx)
+set(AUTOPILOT_DIR ubuntu_docviewer_app)
# Sets BZR_REVNO
execute_process(
@@ -37,87 +26,26 @@
OUTPUT_STRIP_TRAILING_WHITESPACE
)
-if(CLICK_MODE)
- if(NOT DEFINED BZR_SOURCE)
- set(BZR_SOURCE "lp:${LP_PROJECT}")
- message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
- endif(NOT DEFINED BZR_SOURCE)
-
- if(NOT BZR_REVNO)
- set(BZR_REVNO "latest")
- endif(NOT BZR_REVNO)
-
- # Find out the architecture for package building
- # to determine the plugin's installation path
- execute_process(
- COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
- OUTPUT_VARIABLE ARCH_TRIPLET
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- execute_process(
- COMMAND dpkg-architecture -qDEB_HOST_ARCH
- OUTPUT_VARIABLE CLICK_ARCH
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- set(CMAKE_INSTALL_PREFIX /)
- set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}")
- set(BIN_DIR /lib/${ARCH_TRIPLET}/bin)
- set(DATA_DIR /)
- set(ICON ${ICON_FILE})
- set(DESKTOP_DIR ${DATA_DIR})
- set(URLS_DIR ${DATA_DIR})
- configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json docviewer.apparmor docviewer-content.json ${URLS_FILE}
- DESTINATION ${CMAKE_INSTALL_PREFIX})
- # Make the click files visible in Qt Creator
- file(GLOB CLICK_FILES
- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
- *.json *.json.in *.apparmor)
-
- add_custom_target(com_ubuntu_docviewer_CLICKFiles ALL SOURCES ${CLICK_FILES})
-else(CLICK_MODE)
- # components PATH
- execute_process(
- COMMAND qmake -query QT_INSTALL_QML
- OUTPUT_VARIABLE QT_IMPORTS_DIR
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_NAME})
- set(ICON "${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON_FILE}")
- set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
- set(APPLICATION_DIR ${CMAKE_INSTALL_DATADIR}/accounts/applications)
-endif(CLICK_MODE)
-
-file(GLOB_RECURSE I18N_SRC_FILES
- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po
- *.qml *.js *.cpp)
-list(APPEND I18N_SRC_FILES ${CMAKE_CURRENT_BINARY_DIR}/po/${DESKTOP_FILE}.in.in.h)
-list(SORT I18N_SRC_FILES)
-message("Found ${I18N_SRC_FILES}")
-
-file(GLOB SRC_FILES
- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
- *.qml *.js)
-add_custom_target(ubuntu-docviewer-app_QMlFiles ALL SOURCES ${SRC_FILES})
-
-file(GLOB RESOURCE_FILES
- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
- *.png *.svg)
-install(FILES ${SRC_FILES} ${RESOURCE_FILES} ${ICON_FILE} DESTINATION ${DATA_DIR})
-
-configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in)
-
-add_custom_target(${DESKTOP_FILE} ALL
- COMMENT "Merging translations into ${DESKTOP_FILE}"
- COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE}
-)
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
- DESTINATION ${DESKTOP_DIR})
-
+# Find out the architecture for package building
+# to determine the plugin's installation path
+execute_process(
+ COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
+ OUTPUT_VARIABLE ARCH_TRIPLET
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+execute_process(
+ COMMAND dpkg-architecture -qDEB_HOST_ARCH
+ OUTPUT_VARIABLE CLICK_ARCH
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+include(Click)
+
# Tests
enable_testing()
+add_subdirectory(po)
+add_subdirectory(click)
+add_subdirectory(data)
add_subdirectory(src)
add_subdirectory(tests)
-add_subdirectory(po)
=== added directory 'click'
=== added file 'click/CMakeLists.txt'
--- click/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ click/CMakeLists.txt 2015-10-21 13:25:07 +0000
@@ -0,0 +1,17 @@
+if(CLICK_MODE)
+ if(NOT BZR_REVNO)
+ set(BZR_REVNO "latest")
+ endif(NOT BZR_REVNO)
+
+ 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 docviewer.apparmor docviewer-content.json DESTINATION ${CMAKE_INSTALL_PREFIX})
+endif(CLICK_MODE)
+
+
+# Make the click files visible in Qt Creator
+file(GLOB CLICK_FILES
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ *.json *.json.in *.apparmor)
+
+add_custom_target(com_ubuntu_docviewer_CLICKFiles ALL SOURCES ${CLICK_FILES})
=== renamed file 'docviewer-content.json' => 'click/docviewer-content.json'
=== renamed file 'docviewer.apparmor' => 'click/docviewer.apparmor'
=== renamed file 'manifest.json.in' => 'click/manifest.json.in'
=== added directory 'cmake'
=== added directory 'cmake/modules'
=== added file 'cmake/modules/Click.cmake'
--- cmake/modules/Click.cmake 1970-01-01 00:00:00 +0000
+++ cmake/modules/Click.cmake 2015-10-21 13:25:07 +0000
@@ -0,0 +1,18 @@
+if(CLICK_MODE)
+ if(NOT DEFINED BZR_SOURCE)
+ set(BZR_SOURCE "lp:${LP_PROJECT}")
+ message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
+ endif(NOT DEFINED BZR_SOURCE)
+
+ set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}")
+ set(CMAKE_INSTALL_PREFIX /)
+ set(DATA_DIR /)
+else(CLICK_MODE)
+ execute_process(
+ COMMAND qmake -query QT_INSTALL_QML
+ OUTPUT_VARIABLE QT_IMPORTS_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_NAME})
+endif(CLICK_MODE)
=== added directory 'data'
=== added file 'data/CMakeLists.txt'
--- data/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ data/CMakeLists.txt 2015-10-21 13:25:07 +0000
@@ -0,0 +1,29 @@
+if(CLICK_MODE)
+ set(ICON ${ICON_FILE})
+ set(DESKTOP_DIR ${DATA_DIR})
+
+ install(FILES ${ICON_FILE} DESTINATION ${DATA_DIR})
+else(CLICK_MODE)
+ set(ICON "${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON_FILE}")
+ set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
+
+ install(DIRECTORY icons/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/icons
+ FILES_MATCHING PATTERN *.png
+ )
+endif(CLICK_MODE)
+
+set(EXEC "${APP_NAME}")
+
+configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in @ONLY)
+
+add_custom_target(${DESKTOP_FILE} ALL
+ COMMENT "Merging translations into ${DESKTOP_FILE}"
+ COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po
+ ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}.in ${DESKTOP_FILE}
+)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
+ DESTINATION ${DESKTOP_DIR}
+)
+
+install(FILES ${URLS_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX})
=== renamed file 'com.ubuntu.docviewer.desktop.in.in' => 'data/com.ubuntu.docviewer.desktop.in.in'
=== renamed file 'com.ubuntu.docviewer.url-dispatcher' => 'data/com.ubuntu.docviewer.url-dispatcher'
=== renamed file 'docviewer@xxxxxx' => 'data/docviewer@xxxxxx'
=== modified file 'po/CMakeLists.txt'
--- po/CMakeLists.txt 2015-04-29 16:09:12 +0000
+++ po/CMakeLists.txt 2015-10-21 13:25:07 +0000
@@ -17,12 +17,22 @@
set(POT_FILE ${DOMAIN}.pot)
file(GLOB PO_FILES *.po)
+file(GLOB_RECURSE I18N_SRC_FILES
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/*.qml
+ ${CMAKE_SOURCE_DIR}/*.js
+ ${CMAKE_SOURCE_DIR}/*.cpp)
+list(APPEND I18N_SRC_FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}.in.in.h)
+list(SORT I18N_SRC_FILES)
+
+message("Found ${I18N_SRC_FILES}")
+
# Creates the .pot file containing the translations template
add_custom_target(${POT_FILE} ALL
COMMENT "Generating translation template"
# Extract the translatable messages from the desktop file
COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini
- --srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE}.in.in
+ --srcdir=${CMAKE_SOURCE_DIR}/data ${DESKTOP_FILE}.in.in
# Update the translation file
COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
--from-code=UTF-8
@@ -47,7 +57,6 @@
RENAME ${DOMAIN}.mo)
endforeach(PO_FILE)
-
# make the translation files visible on qtcreator
file(GLOB TRANSLATION_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2015-01-29 16:35:28 +0000
+++ src/CMakeLists.txt 2015-10-21 13:25:07 +0000
@@ -1,6 +1,2 @@
-find_package(Qt5Core)
-find_package(Qt5Qml)
-find_package(Qt5Quick)
-
add_subdirectory(app)
add_subdirectory(plugin)
=== modified file 'src/app/CMakeLists.txt'
--- src/app/CMakeLists.txt 2015-10-20 11:58:48 +0000
+++ src/app/CMakeLists.txt 2015-10-21 13:25:07 +0000
@@ -1,6 +1,11 @@
file(GLOB_RECURSE QML_SRCS *.qml *.js)
file(GLOB_RECURSE IMAGE_FILES *.qml *.js)
+find_package(Qt5Core)
+find_package(Qt5Gui)
+find_package(Qt5Qml)
+find_package(Qt5Quick)
+
add_definitions(
-DGETTEXT_PACKAGE=\"${PROJECT_NAME}\"
-DGETTEXT_LOCALEDIR=\"${CMAKE_INSTALL_LOCALEDIR}\"
@@ -23,7 +28,7 @@
add_executable(ubuntu-docviewer-app ${docviewer_SRCS})
-qt5_use_modules(ubuntu-docviewer-app Widgets Gui Qml Quick DBus Concurrent)
+qt5_use_modules(ubuntu-docviewer-app Gui Qml Quick)
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
add_custom_target(docviewer-qmlfiles ALL
=== modified file 'src/plugin/file-qml-plugin/CMakeLists.txt'
--- src/plugin/file-qml-plugin/CMakeLists.txt 2015-09-19 15:40:22 +0000
+++ src/plugin/file-qml-plugin/CMakeLists.txt 2015-10-21 13:25:07 +0000
@@ -1,6 +1,10 @@
set(PLUGIN_DIR DocumentViewer)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+find_package(Qt5Core)
+find_package(Qt5Qml)
+find_package(Qt5Quick)
+
#add the sources to compile
set(fileqmlplugin_SRCS
backend.cpp
=== modified file 'src/plugin/libreofficetoolkit-qml-plugin/CMakeLists.txt'
--- src/plugin/libreofficetoolkit-qml-plugin/CMakeLists.txt 2015-10-18 20:58:32 +0000
+++ src/plugin/libreofficetoolkit-qml-plugin/CMakeLists.txt 2015-10-21 13:25:07 +0000
@@ -1,5 +1,10 @@
set(PLUGIN_DIR DocumentViewer/LibreOffice)
+find_package(Qt5Core)
+find_package(Qt5Gui)
+find_package(Qt5Qml)
+find_package(Qt5Quick)
+
file(GLOB_RECURSE QML_SRCS
qml/*.qml
qml/*.js
=== modified file 'src/plugin/poppler-qml-plugin/CMakeLists.txt'
--- src/plugin/poppler-qml-plugin/CMakeLists.txt 2015-07-14 15:43:11 +0000
+++ src/plugin/poppler-qml-plugin/CMakeLists.txt 2015-10-21 13:25:07 +0000
@@ -1,4 +1,12 @@
set(PLUGIN_DIR DocumentViewer/PDF)
+
+find_package(Qt5Core)
+find_package(Qt5Gui)
+find_package(Qt5Qml)
+find_package(Qt5Quick)
+find_package(Qt5Xml)
+find_package(Qt5Concurrent)
+
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
=== added directory 'tools'
=== renamed file 'run-pep8' => 'tools/run-pep8'
--- run-pep8 2015-04-27 16:29:17 +0000
+++ tools/run-pep8 2015-10-21 13:25:07 +0000
@@ -2,7 +2,7 @@
set -e
echo "= pep8 ="
-for i in `find . -iname '*.py'` ; do
+for i in `find .. -iname '*.py'` ; do
echo "Checking $i"
pep8 $i
done
Follow ups