Externalize build of third parties from the main build

This commit is contained in:
Quentin Rouland 2019-03-22 16:07:04 +01:00
parent 2390cc983b
commit 768fa3cfe0
8 changed files with 41 additions and 49 deletions

12
.gitignore vendored
View File

@ -1,6 +1,12 @@
cmake-build-debug
# Builds dirs
cmake-build-*
build
taglib-build
# IDE
.clickable
.idea
local
*.project
# Third parties ouput dir
third/local

View File

@ -1,6 +1,5 @@
project(UTPass C CXX)
cmake_minimum_required(VERSION 3.5.1)
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
@ -45,9 +44,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INST
install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR})
install(DIRECTORY qml DESTINATION ${DATA_DIR})
install(DIRECTORY assets DESTINATION ${DATA_DIR})
install(DIRECTORY local/bin DESTINATION ${DATA_DIR})
file(GLOB_RECURSE BIN_FILES
"local/bin/*")
"third/local/bin/${ARCH_TRIPLET}/*")
install(
FILES ${BIN_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
@ -75,23 +73,7 @@ add_custom_target(${DESKTOP_FILE_NAME} ALL
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR})
add_subdirectory(third)
add_subdirectory(po)
add_subdirectory(plugins)
add_dependencies(${PROJECT_NAME} Gnupg)
# Make source files visible in qtcreator
# We don't need to add plugin sources here as they get exposed
# via the library target.
file(GLOB_RECURSE PROJECT_SRC_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
qml/*.qml
qml/*.js
*.json
*.json.in
*.apparmor
*.desktop.in
)
add_custom_target(${PROJECT_NAME}_FILES ALL SOURCES ${PROJECT_SRC_FILES})

View File

@ -6,15 +6,17 @@ A password management app for Ubuntu Touch aiming to be compatible with [ZX2C4
* Install [clickable](https://github.com/bhdouglass/clickable).
* Clone this repo : ```git clone --recursive https://github.com/qrouland/UTPass```
* Build the app : ```cd UTPass && clickable```
* Move to app directory: ```cd UTPass```
* Build third parties : ```clickable third_build```
* Build the app : ```clickable```
For more options/details see the [clickable documentation](http://clickable.bhdouglass.com/en/latest/index.html)
## Custom clickable command
* ```clickable test ``` : build and run test for all plugins
* ```clickable test_gpg ``` : build and run test for gpg plugin
* ```clickable test_pass``` : build and run test for pass plugin
* ```clickable style ``` : reformat the code (Required : [astyle](astyle.sourceforge.ne) & [qmlfmt](https://github.com/jesperhh/qmlfmt))
* ```clickable third_build ``` : build third dependencies for arm architecture
* ```clickable third_build_d ``` : build third dependencies for amd64 architecture
* ```clickable third_clean ``` : clean third parties
* ```clickable style ``` : reformat the code (Required [astyle](astyle.sourceforge.ne) & [qmlfmt](https://github.com/jesperhh/qmlfmt) installed)
# Contributing

View File

@ -2,11 +2,10 @@
"template": "cmake",
"kill": "UTPass",
"scripts": {
"clean": "third/clean.sh && rm -rf build",
"style": "astyle --options=.astylerc \"plugins/*.cpp,*.h\" && astyle --options=.astylerc \"tests/*.cpp,*.h\" && qmlfmt -w qml",
"test": "clickable build --arch amd64 && clickable run \"cd build && make test\"",
"test_gpg": "clickable build --arch amd64 && clickable run \"cd build && ./TestGpg\"",
"test_pass": "clickable build --arch amd64 && clickable run \"cd build && ./TestPass\""
"third_build": "clickable run 'cd third && ./clean.sh && mkdir build && cd build && cmake .. && make'",
"third_build_d": "clickable run 'cd third && ./clean.sh && mkdir build && cd build && cmake .. && make' --arch amd64 ",
"third_clean": "cd third && ./clean.sh",
"style": "astyle --options=.astylerc \"plugins/*.cpp,*.h\" && qmlfmt -w tests && qmlfmt -w qml"
},
"dependencies_build": [
"texinfo",

View File

@ -13,11 +13,10 @@ add_library(${PLUGIN} MODULE ${SRC})
set_target_properties(${PLUGIN} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PLUGIN})
qt5_use_modules(${PLUGIN} Qml Quick DBus)
set(EXTERNAL_LIBS "${CMAKE_SOURCE_DIR}/local")
set(EXTERNAL_LIBS "${CMAKE_SOURCE_DIR}/third/local/${ARCH_TRIPLET}")
set(THIRD_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
INCLUDE_DIRECTORIES(${EXTERNAL_LIBS}/include)
add_dependencies(${PLUGIN} LibGpgme)
add_library(GpgError STATIC IMPORTED)
set_property(TARGET GpgError PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libgpg-error.a")

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: utpass.qrouland\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-03-21 21:15+0000\n"
"POT-Creation-Date: 2019-03-22 15:10+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,6 +17,10 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../qml/pages/Settings.qml:8 ../qml/pages/headers/MainHeader.qml:49
msgid "Settings"
msgstr ""
#: ../qml/pages/PasswordList.qml:16
msgid "Back"
msgstr ""
@ -25,24 +29,20 @@ msgstr ""
msgid "No password found in the current folder"
msgstr ""
#: ../qml/pages/Settings.qml:8 ../qml/pages/headers/MainHeader.qml:49
msgid "Settings"
#: ../qml/pages/Info.qml:9 ../qml/pages/headers/MainHeader.qml:56
msgid "Info"
msgstr ""
#: ../qml/pages/headers/MainHeader.qml:8 ../qml/pages/headers/StackHeader.qml:8
#: ../qml/pages/Info.qml:43 UTPass.desktop.in.h:1
#: ../qml/pages/Info.qml:43 ../qml/pages/headers/MainHeader.qml:8
#: ../qml/pages/headers/StackHeader.qml:8 UTPass.desktop.in.h:1
msgid "UTPass"
msgstr ""
#: ../qml/pages/Info.qml:53
msgid "Suggest improvement(s) or report a bug(s)"
msgstr ""
#: ../qml/pages/headers/MainHeader.qml:23
#: ../qml/pages/headers/MainHeader.qml:38
msgid "Search"
msgstr ""
#: ../qml/pages/headers/MainHeader.qml:56 ../qml/pages/Info.qml:9
msgid "Info"
msgstr ""
#: ../qml/pages/Info.qml:53
msgid "Suggest improvement(s) or report a bug(s)"
msgstr ""

View File

@ -1,4 +1,6 @@
cmake_minimum_required(VERSION 3.5.1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
execute_process(
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
@ -7,7 +9,7 @@ execute_process(
)
set(EXTERNAL_LIBS "${CMAKE_SOURCE_DIR}/local")
set(EXTERNAL_LIBS "${CMAKE_SOURCE_DIR}/local/${ARCH_TRIPLET}")
set(THIRD_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
set(LIBGPGERROR_PATH "${THIRD_PATH}/libgpg-error")
set(LIBASSUAN_PATH "${THIRD_PATH}/libassuan")

View File

@ -1,7 +1,9 @@
#!/bin/sh
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
cd $SCRIPTPATH && rm -rf build
git submodule update --init --recursive
for LIB in "gnupg" "gpgme" "libassuan" "libgpg-error"
do
echo $LIB