2015-12-05 22:52:00 +01:00
|
|
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
|
2019-07-20 18:10:54 +02:00
|
|
|
# set meta data
|
|
|
|
project(passwordmanager)
|
|
|
|
set(META_PROJECT_NAME ${PROJECT_NAME})
|
2017-04-27 22:16:26 +02:00
|
|
|
set(META_PROJECT_VARNAME password_manager)
|
2016-07-27 18:29:00 +02:00
|
|
|
set(META_PROJECT_TYPE application)
|
2015-12-05 22:52:00 +01:00
|
|
|
set(META_APP_NAME "Password Manager")
|
2016-11-08 19:37:26 +01:00
|
|
|
set(META_APP_CATEGORIES "Utility;Security;")
|
2015-12-05 22:52:00 +01:00
|
|
|
set(META_APP_AUTHOR "Martchus")
|
|
|
|
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
|
2016-07-27 18:29:00 +02:00
|
|
|
set(META_APP_DESCRIPTION "A simple password store using AES-256-CBC encryption via OpenSSL")
|
2018-06-16 13:23:13 +02:00
|
|
|
set(META_GUI_OPTIONAL YES)
|
|
|
|
set(META_USE_QQC2 ON)
|
2019-08-22 01:10:35 +02:00
|
|
|
set(META_ANDROID_PACKAGE_NAME "org.martchus.passwordmanager")
|
2018-12-18 23:17:55 +01:00
|
|
|
set(META_VERSION_MAJOR 4)
|
2019-07-06 17:24:24 +02:00
|
|
|
set(META_VERSION_MINOR 1)
|
2020-03-28 23:13:34 +01:00
|
|
|
set(META_VERSION_PATCH 4)
|
2018-12-22 00:42:01 +01:00
|
|
|
set(PNG_ICON_NO_CROP ON)
|
2015-12-05 22:52:00 +01:00
|
|
|
|
2015-12-08 08:37:18 +01:00
|
|
|
# add project files
|
2019-02-06 17:58:29 +01:00
|
|
|
set(HEADER_FILES cli/cli.h model/entryfiltermodel.h model/entrymodel.h model/fieldmodel.h)
|
|
|
|
set(SRC_FILES cli/cli.cpp main.cpp)
|
|
|
|
|
|
|
|
set(GUI_HEADER_FILES model/entryfiltermodel.cpp model/entrymodel.cpp model/fieldmodel.cpp)
|
|
|
|
set(GUI_SRC_FILES model/entryfiltermodel.cpp model/entrymodel.cpp model/fieldmodel.cpp)
|
2016-04-16 00:51:52 +02:00
|
|
|
|
2015-12-08 08:37:18 +01:00
|
|
|
set(WIDGETS_HEADER_FILES
|
|
|
|
gui/fielddelegate.h
|
|
|
|
gui/initiategui.h
|
|
|
|
gui/mainwindow.h
|
|
|
|
gui/passwordgeneratordialog.h
|
|
|
|
gui/stacksupport.h
|
2019-02-06 17:58:29 +01:00
|
|
|
gui/undocommands.h)
|
2015-12-08 08:37:18 +01:00
|
|
|
set(WIDGETS_SRC_FILES
|
|
|
|
gui/fielddelegate.cpp
|
2019-08-22 01:11:17 +02:00
|
|
|
gui/initiategui.cpp
|
2015-12-08 08:37:18 +01:00
|
|
|
gui/mainwindow.cpp
|
|
|
|
gui/passwordgeneratordialog.cpp
|
|
|
|
gui/stacksupport.cpp
|
|
|
|
gui/undocommands.cpp
|
2019-02-06 17:58:29 +01:00
|
|
|
resources/icons.qrc)
|
|
|
|
set(WIDGETS_UI_FILES gui/mainwindow.ui gui/passwordgeneratordialog.ui)
|
|
|
|
|
|
|
|
set(QML_HEADER_FILES quickgui/controller.h quickgui/initiatequick.h)
|
|
|
|
set(QML_SRC_FILES quickgui/controller.cpp quickgui/initiatequick.cpp resources/icons.qrc resources/qml.qrc)
|
|
|
|
if (ANDROID)
|
|
|
|
list(APPEND QML_HEADER_FILES quickgui/android.h)
|
|
|
|
list(APPEND QML_SRC_FILES quickgui/android.cpp)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
|
|
|
|
|
|
|
|
set(ICON_FILES resources/icons/hicolor/scalable/apps/${META_PROJECT_NAME}.svg)
|
|
|
|
|
|
|
|
set(DOC_FILES README.md)
|
2016-06-14 00:49:29 +02:00
|
|
|
|
2016-07-16 23:13:06 +02:00
|
|
|
set(REQUIRED_ICONS
|
2018-08-31 22:29:01 +02:00
|
|
|
application-exit
|
|
|
|
applications-internet
|
2017-04-23 13:02:36 +02:00
|
|
|
dialog-cancel
|
2016-07-16 23:13:06 +02:00
|
|
|
dialog-ok
|
2017-04-23 13:02:36 +02:00
|
|
|
dialog-ok-apply
|
2016-07-16 23:13:06 +02:00
|
|
|
dialog-password
|
2018-08-31 22:29:01 +02:00
|
|
|
document-close
|
2018-09-09 00:57:02 +02:00
|
|
|
document-encrypt
|
2018-08-31 22:29:01 +02:00
|
|
|
document-export
|
2016-07-16 23:13:06 +02:00
|
|
|
document-new
|
2018-08-31 22:29:01 +02:00
|
|
|
document-open
|
|
|
|
document-open-recent
|
2018-12-21 01:14:41 +01:00
|
|
|
document-properties
|
2016-07-16 23:13:06 +02:00
|
|
|
document-save
|
2018-08-31 22:29:01 +02:00
|
|
|
document-save-as
|
|
|
|
edit-clear
|
|
|
|
edit-copy
|
|
|
|
edit-cut
|
|
|
|
edit-delete
|
|
|
|
edit-paste
|
2016-07-16 23:13:06 +02:00
|
|
|
edit-redo
|
2018-08-31 22:29:01 +02:00
|
|
|
edit-rename
|
|
|
|
edit-undo
|
2018-09-10 23:28:02 +02:00
|
|
|
emblem-warning
|
2018-08-31 22:29:01 +02:00
|
|
|
flag-black
|
|
|
|
flag-blue
|
|
|
|
folder
|
2018-09-09 00:57:02 +02:00
|
|
|
folder-add
|
2018-08-31 22:29:01 +02:00
|
|
|
folder-symbolic
|
2016-07-16 23:13:06 +02:00
|
|
|
go-next
|
2018-09-10 23:28:02 +02:00
|
|
|
go-next-symbolic
|
|
|
|
go-next-symbolic-rtl
|
|
|
|
go-previous
|
|
|
|
go-previous-symbolic
|
|
|
|
go-previous-symbolic-rtl
|
2018-09-09 01:49:12 +02:00
|
|
|
handle-right
|
|
|
|
handle-sort
|
|
|
|
overflow-menu-right
|
|
|
|
overflow-menu-left
|
2018-08-31 22:29:01 +02:00
|
|
|
help-about
|
|
|
|
insert-text
|
|
|
|
list-add
|
|
|
|
list-remove
|
2019-02-05 00:27:18 +01:00
|
|
|
password-copy
|
2016-08-16 00:37:17 +02:00
|
|
|
password-generate
|
2018-08-31 22:29:01 +02:00
|
|
|
password-show-off
|
|
|
|
password-show-on
|
2017-04-23 13:02:36 +02:00
|
|
|
preferences-desktop-icons
|
|
|
|
preferences-desktop-locale
|
2018-08-31 22:29:01 +02:00
|
|
|
qtcreator
|
2018-11-22 22:02:27 +01:00
|
|
|
search
|
2018-08-31 22:29:01 +02:00
|
|
|
story-editor
|
|
|
|
system-file-manager
|
|
|
|
system-run
|
2017-04-23 13:02:36 +02:00
|
|
|
system-search
|
2019-02-05 00:27:18 +01:00
|
|
|
username-copy
|
2019-02-06 17:58:29 +01:00
|
|
|
window-close)
|
2016-07-16 23:13:06 +02:00
|
|
|
|
2016-04-16 00:51:52 +02:00
|
|
|
# find c++utilities
|
2019-03-13 19:09:31 +01:00
|
|
|
set(CONFIGURATION_PACKAGE_SUFFIX ""
|
|
|
|
CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
|
|
|
|
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
|
2016-04-16 00:51:52 +02:00
|
|
|
use_cpp_utilities()
|
2018-12-15 22:57:00 +01:00
|
|
|
|
|
|
|
# apply basic configuration
|
2016-08-16 00:37:17 +02:00
|
|
|
include(BasicConfig)
|
2015-12-08 08:37:18 +01:00
|
|
|
|
2016-04-16 00:51:52 +02:00
|
|
|
# find qtutilities
|
2019-03-13 19:09:31 +01:00
|
|
|
find_package(qtutilities${CONFIGURATION_PACKAGE_SUFFIX} 6.0.0 REQUIRED)
|
2018-09-16 00:33:55 +02:00
|
|
|
use_qt_utilities()
|
2016-04-07 23:51:03 +02:00
|
|
|
|
2016-04-16 00:51:52 +02:00
|
|
|
# find passwordfile
|
2019-03-13 19:09:31 +01:00
|
|
|
find_package(passwordfile${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
|
2016-04-16 00:51:52 +02:00
|
|
|
use_password_file()
|
2015-12-05 22:52:00 +01:00
|
|
|
|
2019-01-21 18:16:17 +01:00
|
|
|
# require at least Qt 5.8 for the Qt Quick GUI
|
2019-02-06 17:58:29 +01:00
|
|
|
if (QUICK_GUI)
|
2018-12-15 22:57:00 +01:00
|
|
|
set(META_QT5_VERSION 5.8)
|
2019-02-06 17:58:29 +01:00
|
|
|
endif ()
|
2018-12-15 22:57:00 +01:00
|
|
|
|
2019-02-06 17:58:29 +01:00
|
|
|
# allow to enable undo support from the widgets GUI in the quick GUI as well (so the quick GUI will depend on Qt Widgets as
|
|
|
|
# well)
|
|
|
|
if (QUICK_GUI AND NOT WIDGETS_GUI)
|
2018-12-15 22:57:00 +01:00
|
|
|
option(ENABLE_UNDO_SUPPORT_FOR_QUICK_GUI "enables with undo/redo support for the Qt Quick GUI (requires Qt Widgets)" ON)
|
2019-02-06 17:58:29 +01:00
|
|
|
if (ENABLE_UNDO_SUPPORT_FOR_QUICK_GUI)
|
2018-12-15 22:57:00 +01:00
|
|
|
list(APPEND ADDITIONAL_QT_MODULES Widgets)
|
|
|
|
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_ENABLE_UNDO_SUPPORT_FOR_QUICK_GUI)
|
2019-02-06 17:58:29 +01:00
|
|
|
list(APPEND QML_HEADER_FILES gui/stacksupport.h gui/undocommands.h)
|
|
|
|
list(APPEND QML_SRC_FILES gui/stacksupport.cpp gui/undocommands.cpp)
|
|
|
|
endif ()
|
|
|
|
endif ()
|
2018-12-15 22:57:00 +01:00
|
|
|
|
|
|
|
# add further Qt/KF modules required by the Qt Quick GUI under Android
|
2019-02-06 17:58:29 +01:00
|
|
|
if (ANDROID AND QUICK_GUI)
|
2018-09-02 19:07:02 +02:00
|
|
|
list(APPEND ADDITIONAL_QT_MODULES AndroidExtras)
|
2018-09-16 00:33:55 +02:00
|
|
|
list(APPEND ADDITIONAL_KF_MODULES Kirigami2)
|
2019-02-06 17:58:29 +01:00
|
|
|
endif ()
|
2018-09-02 19:07:02 +02:00
|
|
|
|
2018-12-15 22:57:00 +01:00
|
|
|
# apply further configuration
|
2019-02-06 17:58:29 +01:00
|
|
|
if (WIDGETS_GUI OR QUICK_GUI)
|
2016-07-27 18:29:00 +02:00
|
|
|
include(QtGuiConfig)
|
|
|
|
include(QtConfig)
|
2019-02-06 17:58:29 +01:00
|
|
|
endif ()
|
2016-04-16 00:51:52 +02:00
|
|
|
include(WindowsResources)
|
|
|
|
include(AppTarget)
|
2018-09-16 00:33:55 +02:00
|
|
|
include(AndroidApk)
|
2016-07-04 23:29:49 +02:00
|
|
|
include(ShellCompletion)
|
2016-07-27 21:40:34 +02:00
|
|
|
include(ConfigHeader)
|
2016-04-07 23:51:03 +02:00
|
|
|
|
2016-04-16 00:51:52 +02:00
|
|
|
# create desktop file using previously defined meta data
|
|
|
|
add_desktop_file()
|