summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2019-10-21 23:38:47 +0200
committerAnne Jan Brouwer <brouwer@annejan.com>2019-10-21 23:38:47 +0200
commit89e99ba6a748189827d2944a9a65468ea0f77abe (patch)
treed10e407fc881c18f89d82c7829ec6c48b8cff441
parent6049257b300b93754b18b672aa4d1269b5abdba8 (diff)
Split WIP
-rw-r--r--.gitignore7
-rw-r--r--CMakeLists.txt74
-rw-r--r--README.md10
-rw-r--r--main/CMakeLists.txt14
-rw-r--r--src/CMakeLists.txt80
5 files changed, 115 insertions, 70 deletions
diff --git a/.gitignore b/.gitignore
index 9f7a7950..a9297153 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,3 +45,10 @@ cmake-build-debug/**
cmake_install.cmake
qtpass.cbp
qtpass_autogen/**
+libqtpasslib.a
+main/CMakeFiles/**
+qtpasslib_autogen/**
+src/CMakeFiles/**
+main/qtpass_autogen/**
+src/localization/**
+src/qtpasslib_autogen/** \ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5f99d11..49ff5cd4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,79 +1,15 @@
cmake_minimum_required(VERSION 3.15)
project(qtpass)
-
set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_AUTOUIC ON)
-set(CMAKE_AUTORCC ON)
-
add_compile_definitions(VERSION="1.3.2")
-include_directories(src)
-
+find_package(Qt5LinguistTools)
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
-find_package(Qt5GUI REQUIRED)
-find_package(Qt5LinguistTools REQUIRED)
-
-file(GLOB TS_FILES "${CMAKE_CURRENT_SOURCE_DIR}/localization/*.ts")
-set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION localization)
-qt5_add_translation(QM_FILES ${TS_FILES})
-
-add_library(qtpasslib
- src/configdialog.cpp
- src/configdialog.h
- src/debughelper.h
- src/deselectabletreeview.h
- src/enums.h
- src/executor.cpp
- src/executor.h
- src/filecontent.cpp
- src/filecontent.h
- src/imitatepass.cpp
- src/imitatepass.h
- src/keygendialog.cpp
- src/keygendialog.h
- src/mainwindow.cpp
- src/mainwindow.h
- src/pass.cpp
- src/pass.h
- src/passwordconfiguration.h
- src/passworddialog.cpp
- src/passworddialog.h
- src/qprogressindicator.cpp
- src/qprogressindicator.h
- src/qpushbuttonasqrcode.cpp
- src/qpushbuttonasqrcode.h
- src/qpushbuttonwithclipboard.cpp
- src/qpushbuttonwithclipboard.h
- src/qtpass.cpp
- src/qtpass.h
- src/qtpasssettings.cpp
- src/qtpasssettings.h
- src/realpass.cpp
- src/realpass.h
- src/settingsconstants.cpp
- src/settingsconstants.h
- src/simpletransaction.cpp
- src/simpletransaction.h
- src/singleapplication.cpp
- src/singleapplication.h
- src/storemodel.cpp
- src/storemodel.h
- src/trayicon.cpp
- src/trayicon.h
- src/userinfo.h
- src/usersdialog.cpp
- src/usersdialog.h
- src/util.cpp
- src/util.h
- resources.qrc
- ${QM_FILES})
-
-target_link_libraries(qtpasslib Qt5::Core Qt5::Widgets Qt5::Network)
-
-add_executable(qtpass
- main/main.cpp)
+find_package(Qt5Gui REQUIRED)
+find_package(Qt5Svg REQUIRED)
-target_link_libraries(qtpass qtpasslib) \ No newline at end of file
+add_subdirectory(src)
+add_subdirectory(main) \ No newline at end of file
diff --git a/README.md b/README.md
index f2c1437e..8619b404 100644
--- a/README.md
+++ b/README.md
@@ -76,7 +76,15 @@ On Mac OS X this currently seems to only work best with `pinentry-mac` from home
On most unix systems all you need is:
```
-qmake && make && make install
+qmake
+make
+make install
+```
+
+Currently broken:
+```
+cmake .
+make
```
Testing
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
new file mode 100644
index 00000000..4b37bc87
--- /dev/null
+++ b/main/CMakeLists.txt
@@ -0,0 +1,14 @@
+include_directories(../src)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+file(GLOB TS_FILES "../localization/*.ts")
+set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION localization)
+qt5_add_translation(QM_FILES ${TS_FILES})
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+add_executable(qtpass
+ main.cpp)
+
+target_link_libraries(qtpass qtpasslib Qt5::Widgets Qt5::Network Qt5::Svg)
+add_compile_definitions(QAPPLICATION_CLASS=QApplication)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 00000000..75e930dc
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,80 @@
+#set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+add_compile_definitions(CORE_LIBRARY)
+
+file(GLOB TS_FILES "../localization/*.ts")
+set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION localization)
+qt5_add_translation(QM_FILES ${TS_FILES})
+add_custom_target(translations DEPENDS ${QM_FILES})
+
+qt5_wrap_ui(ui_configdialog.h configdialog.ui)
+qt5_wrap_ui(ui_keygendialog.h keygendialog.ui)
+qt5_wrap_ui(ui_mainwindow.h mainwindow.ui)
+qt5_wrap_ui(ui_passworddialog.h passworddialog.ui)
+qt5_wrap_ui(ui_usersdialog.h usersdialog.ui)
+
+set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${Qt5Svg_EXECUTABLE_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${Qt5Network_EXECUTABLE_COMPILE_FLAGS}")
+
+add_library(qtpasslib #SHARED
+ configdialog.cpp
+ configdialog.h
+ configdialog.ui
+ debughelper.h
+ deselectabletreeview.h
+ enums.h
+ executor.cpp
+ executor.h
+ filecontent.cpp
+ filecontent.h
+ imitatepass.cpp
+ imitatepass.h
+ keygendialog.cpp
+ keygendialog.h
+ keygendialog.ui
+ mainwindow.cpp
+ mainwindow.h
+ mainwindow.ui
+ pass.cpp
+ pass.h
+ passwordconfiguration.h
+ passworddialog.cpp
+ passworddialog.h
+ passworddialog.ui
+ qprogressindicator.cpp
+ qprogressindicator.h
+ qpushbuttonasqrcode.cpp
+ qpushbuttonasqrcode.h
+ qpushbuttonwithclipboard.cpp
+ qpushbuttonwithclipboard.h
+ qtpass.cpp
+ qtpass.h
+ qtpasssettings.cpp
+ qtpasssettings.h
+ realpass.cpp
+ realpass.h
+ settingsconstants.cpp
+ settingsconstants.h
+ simpletransaction.cpp
+ simpletransaction.h
+ singleapplication.cpp
+ singleapplication.h
+ storemodel.cpp
+ storemodel.h
+ trayicon.cpp
+ trayicon.h
+ userinfo.h
+ usersdialog.cpp
+ usersdialog.h
+ usersdialog.ui
+ util.cpp
+ util.h
+ ../resources.qrc
+ ${QM_FILES})
+
+target_link_libraries(qtpasslib Qt5::Widgets Qt5::Network Qt5::Svg)
+add_compile_definitions(QAPPLICATION_CLASS=QApplication)