From f3b12f90b4bbe53e47ae349f6ada5f3f0ee9141f Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 31 Aug 2018 22:35:53 +0200 Subject: [PATCH] Update password manager project for Qt Quick / Android * At least attempt to bundle ECM and Kirigami * Add GUI options * Add symlink to android folder so ECM can find it * Add symlink to qml files so the imports of these files are considered by androiddeployqt --- passwordmanager/CMakeLists.txt | 27 +++++++++++++++++++++++++++ passwordmanager/android | 1 + passwordmanager/qml | 1 + 3 files changed, 29 insertions(+) create mode 120000 passwordmanager/android create mode 120000 passwordmanager/qml diff --git a/passwordmanager/CMakeLists.txt b/passwordmanager/CMakeLists.txt index bed1d3f..2005745 100644 --- a/passwordmanager/CMakeLists.txt +++ b/passwordmanager/CMakeLists.txt @@ -10,11 +10,38 @@ add_subdirectory(${SUBDIRS_PREFIX}/c++utilities c++utilities) list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_SOURCE_DIR}/cmake/modules) link_directories(${CPP_UTILITIES_BINARY_DIR}) +option(WIDGETS_GUI "enables/disables building the Qt Widgets GUI: yes (default) or no" ON) +option(QUICK_GUI "enables/disables building the Qt Quick GUI: yes (default) or no" ON) if(WIDGETS_GUI OR QUICK_GUI) add_subdirectory(${SUBDIRS_PREFIX}/qtutilities qtutilities) list(APPEND CMAKE_MODULE_PATH ${QT_UTILITIES_SOURCE_DIR}/cmake/modules) link_directories(${QT_UTILITIES_BINARY_DIR}) endif() +if(QUICK_GUI) + set(ECM_PATH OFF CACHE PATH "specifies the (relative) path to the extra-cmake-modules sources for building it together with passwordmanager") + if(NOT ECM_PATH) + message(STATUS "Using system extra-cmake-modules (ECM_PATH not set)") + else() + # FIXME: building ecm in the same project doesn't seem to work since it has references to the installed location + add_subdirectory("${ECM_PATH}" ecm) + #file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/bundled-ecm") + #file(WRITE "${CMAKE_BINARY_DIR}/bundled-ecm/ECMConfig.cmake" "set(ECM_MODULE_DIR ${ECM_PATH}/modules)") + set(ECM_DIR "${CMAKE_BINARY_DIR}/bundled-ecm") + list(APPEND CMAKE_MODULE_PATH + "${ECM_PATH}/modules" + "${ECM_PATH}/kde-modules" + "${ECM_PATH}/find-modules" + ) + endif() + + set(KIRIGAMI_PATH OFF CACHE PATH "specifies the (relative) path to the Kirigami 2 sources for building it together with passwordmanager") + if(NOT KIRIGAMI_PATH) + message(STATUS "Using system Kirigami (KIRIGAMI_PATH not set)") + else() + add_subdirectory("${KIRIGAMI_PATH}" kirigami) + list(APPEND CMAKE_MODULE_PATH "${KIRIGAMI_PATH}") + endif() +endif() add_subdirectory(${SUBDIRS_PREFIX}/passwordfile passwordfile) link_directories(${PASSWORD_FILE_BINARY_DIR}) diff --git a/passwordmanager/android b/passwordmanager/android new file mode 120000 index 0000000..f7b422c --- /dev/null +++ b/passwordmanager/android @@ -0,0 +1 @@ +../../passwordmanager/android \ No newline at end of file diff --git a/passwordmanager/qml b/passwordmanager/qml new file mode 120000 index 0000000..b786f35 --- /dev/null +++ b/passwordmanager/qml @@ -0,0 +1 @@ +../../passwordmanager/qml \ No newline at end of file