passwordmanager/CMakeLists.txt

213 lines
4.7 KiB
CMake
Raw Normal View History

2015-12-05 22:52:00 +01:00
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
# meta data
set(META_PROJECT_NAME passwordmanager)
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")
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")
set(META_GUI_OPTIONAL YES)
set(META_USE_QQC2 ON)
2018-12-18 23:17:55 +01:00
set(META_VERSION_MAJOR 4)
set(META_VERSION_MINOR 0)
2019-01-21 18:16:17 +01:00
set(META_VERSION_PATCH 1)
2015-12-08 08:37:18 +01:00
set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH})
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
set(HEADER_FILES
cli/cli.h
model/entryfiltermodel.h
model/entrymodel.h
model/fieldmodel.h
)
set(SRC_FILES
cli/cli.cpp
main.cpp
2016-07-27 18:29:00 +02:00
)
set(GUI_HEADER_FILES
model/entryfiltermodel.cpp
model/entrymodel.cpp
model/fieldmodel.cpp
)
set(GUI_SRC_FILES
2015-12-08 08:37:18 +01:00
model/entryfiltermodel.cpp
model/entrymodel.cpp
model/fieldmodel.cpp
)
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
gui/undocommands.h
)
set(WIDGETS_SRC_FILES
gui/fielddelegate.cpp
gui/initiatequi.cpp
gui/mainwindow.cpp
gui/passwordgeneratordialog.cpp
gui/stacksupport.cpp
gui/undocommands.cpp
resources/icons.qrc
)
2016-01-25 19:05:04 +01:00
set(WIDGETS_UI_FILES
gui/mainwindow.ui
gui/passwordgeneratordialog.ui
)
set(QML_HEADER_FILES
quickgui/controller.h
2015-12-08 08:37:18 +01:00
quickgui/initiatequick.h
)
set(QML_SRC_FILES
quickgui/controller.cpp
2015-12-08 08:37:18 +01:00
quickgui/initiatequick.cpp
resources/icons.qrc
resources/qml.qrc
)
2018-09-04 00:52:43 +02:00
if(ANDROID)
list(APPEND QML_HEADER_FILES
quickgui/android.h
)
list(APPEND QML_SRC_FILES
quickgui/android.cpp
)
endif()
2015-12-08 08:37:18 +01:00
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
2015-12-05 22:52:00 +01:00
)
2016-06-14 00:49:29 +02:00
set(DOC_FILES
README.md
)
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
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
username-copy
2018-08-31 22:29:01 +02:00
window-close
2016-07-16 23:13:06 +02:00
)
# find c++utilities
2017-09-29 17:16:44 +02:00
find_package(c++utilities 4.10.0 REQUIRED)
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
# find qtutilities
find_package(qtutilities 5.11.0 REQUIRED)
use_qt_utilities()
2016-04-07 23:51:03 +02:00
# find passwordfile
2018-12-18 23:17:55 +01:00
find_package(passwordfile 4.0.0 REQUIRED)
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
2018-12-15 22:57:00 +01:00
if(QUICK_GUI)
set(META_QT5_VERSION 5.8)
endif()
# 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)
option(ENABLE_UNDO_SUPPORT_FOR_QUICK_GUI "enables with undo/redo support for the Qt Quick GUI (requires Qt Widgets)" ON)
if(ENABLE_UNDO_SUPPORT_FOR_QUICK_GUI)
list(APPEND ADDITIONAL_QT_MODULES Widgets)
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_ENABLE_UNDO_SUPPORT_FOR_QUICK_GUI)
list(APPEND QML_HEADER_FILES
gui/stacksupport.h
gui/undocommands.h
)
list(APPEND QML_SRC_FILES
gui/stacksupport.cpp
gui/undocommands.cpp
)
endif()
2018-12-15 22:57:00 +01:00
endif()
# add further Qt/KF modules required by the Qt Quick GUI under Android
if(ANDROID AND QUICK_GUI)
2018-09-02 19:07:02 +02:00
list(APPEND ADDITIONAL_QT_MODULES AndroidExtras)
list(APPEND ADDITIONAL_KF_MODULES Kirigami2)
2018-09-02 19:07:02 +02:00
endif()
2018-12-15 22:57:00 +01:00
# apply further configuration
2016-07-27 18:29:00 +02:00
if(WIDGETS_GUI OR QUICK_GUI)
include(QtGuiConfig)
include(QtConfig)
endif()
include(WindowsResources)
include(AppTarget)
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
# create desktop file using previously defined meta data
add_desktop_file()