diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4820a6e8c..7f67490e3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -59,7 +59,7 @@ jobs: QT_PKGS: ${{ matrix.qt-version-major == '6' && 'qt6-base-private-dev libgl-dev' || 'qtbase5-private-dev' }} run: | sudo apt update - sudo apt install -y build-essential qtchooser ${{ env.QT_PKGS }} + sudo apt install -y build-essential cmake ninja-build ${{ env.QT_PKGS }} - name: Setup GCC problem matcher if: matrix.build-type == 'debug' @@ -70,11 +70,9 @@ jobs: run: | mkdir build cd build - # Workaround for qtchooser not supporting Qt 6: https://bugs.launchpad.net/ubuntu/+source/qtchooser/+bug/1964763 - echo -e '/usr/lib/qt6/bin\n/usr/lib/x86_64-linux-gnu' | sudo tee /usr/lib/x86_64-linux-gnu/qtchooser/qt6.conf - export QT_SELECT=qt${{ matrix.qt-version-major }} - qmake -config ${{ matrix.build-type }} ../src/Notes.pro - make -j$(nproc) + cmake .. -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} + export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) + cmake --build . # Build the AppImage using official Qt releases, downloaded by aqtinstall. # This is also done for macOS and Windows, just to make sure we use the exact same Qt version across all three OSes. @@ -112,20 +110,23 @@ jobs: apt update - name: Install other dependencies in docker container + # - cmake: Used to build the application # - curl: Used to download the linuxdeploy AppImage tool. # - git: Self-explanatory. # - libfontconfig1: Used as dependency of the resulting AppImage. + # - ninja-build: needed by cmake # - python3/python3-pip: Used by aqtinstall. # - sudo: Used by most GitHub actions to install things. if: matrix.container != '' run: | - apt update - apt install -y curl git libfontconfig1 python3 python3-pip sudo - # Upgrade to the latest setuptools, as Ubuntu's python3-setuptools package has compatibility issues with aqtinstall. - python3 -m pip install --upgrade setuptools # Configure the timezone, otherwise 'install-qt-action' gets stuck at 'configuring tzdata'. ln -sf /usr/share/zoneinfo/UTC /etc/localtime echo UTC > /etc/timezone + # install packages + apt update + apt install -y cmake curl git libfontconfig1 ninja-build python3 python3-pip sudo + # Upgrade to the latest setuptools, as Ubuntu's python3-setuptools package has compatibility issues with aqtinstall. + python3 -m pip install --upgrade setuptools - name: Checkout code uses: actions/checkout@v3 @@ -135,12 +136,12 @@ jobs: - name: Update version shell: bash run: | - sed -i.bak "/^VERSION *=/ s/$/-g${GITHUB_SHA::7}/" src/Notes.pro + sed -i.bak "s/PROJECT_VERSION *[^)]\+/&-g${GITHUB_SHA::7}/" CMakeLists.txt - name: Setup variables id: vars run: | - version=$(grep -m 1 VERSION src/Notes.pro | sed 's/^VERSION *= *//') + version=$(grep -m 1 'PROJECT_VERSION' CMakeLists.txt | sed 's/.*PROJECT_VERSION *//' | sed 's/).*//') artifact_name="Notes_${version}-x86_64-Qt${{ matrix.qt-version }}" file_name="$artifact_name${{ matrix.build-type == 'debug' && '-debug.' || '.' }}AppImage" echo "version=$version" >> $GITHUB_OUTPUT @@ -166,8 +167,9 @@ jobs: run: | mkdir build cd build - qmake -config ${{ matrix.build-type }} ../src/Notes.pro - make -j$(nproc) + cmake .. -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} + export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) + cmake --build . - name: Setup linuxdeploy run: | diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 7d7d3b07c..49b9d7338 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -27,9 +27,12 @@ jobs: submodules: recursive - name: Install Qt ${{ matrix.qt-version-major }} (homebrew) + env: + # TODO: remove once https://github.com/actions/setup-python/issues/577 gets fixed. + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 run: | brew update - brew install qt@${{ matrix.qt-version-major }} + brew install ninja qt@${{ matrix.qt-version-major }} - name: Configure Qt ${{ matrix.qt-version-major }} (homebrew) run: | @@ -47,10 +50,9 @@ jobs: - name: Build (${{ matrix.build-type }}) run: | - mkdir build - cd build - qmake -config ${{ matrix.build-type }} ../src/Notes.pro - make -j$(sysctl -n hw.logicalcpu) + export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu) + cmake . -G Ninja -B build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_PREFIX_PATH="$(brew --prefix qt@${{ matrix.qt-version-major }})" + cmake --build build # Build the dmg disk image using the official Qt 5 release downloaded by aqtinstall. # This is also done for Linux and Windows, just to make sure we use the exact same Qt version across all three OSes. @@ -78,12 +80,12 @@ jobs: - name: Update version run: | - sed -i.bak "/^VERSION *=/ s/$/-g${GITHUB_SHA::7}/" src/Notes.pro + sed -i.bak "s/PROJECT_VERSION *[^)]\+/&-g${GITHUB_SHA::7}/" CMakeLists.txt - name: Setup variables id: vars run: | - version=$(grep -m 1 VERSION src/Notes.pro | sed 's/^VERSION *= *//') + version=$(grep -m 1 'PROJECT_VERSION' CMakeLists.txt | sed 's/.*PROJECT_VERSION *//' | sed 's/).*//') artifact_name="Notes_${version}-x86_64-Qt${{ matrix.qt-version }}" file_name="$artifact_name${{ matrix.build-type == 'debug' && '-debug.' || '.' }}dmg" echo "version=$version" >> $GITHUB_OUTPUT @@ -96,18 +98,22 @@ jobs: version: ${{ matrix.qt-version }} cache: true + - name: Install Ninja + run: | + brew update + brew install ninja + - name: Build (${{ matrix.build-type }}) run: | - mkdir build - cd build - qmake -config ${{ matrix.build-type }} ../src/Notes.pro - make -j$(sysctl -n hw.logicalcpu) + export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu) + cmake . -G Ninja -B build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} + cmake --build build - name: Build dmg (${{ matrix.build-type }}) run: | - cd bin + cd build plutil -insert NSRequiresAquaSystemAppearance -bool true Notes.app/Contents/Info.plist - plutil -insert CFBundleName -string Notes Notes.app/Contents/Info.plist + plutil -replace CFBundleName -string Notes Notes.app/Contents/Info.plist macdeployqt Notes.app -dmg mv Notes.dmg '${{ steps.vars.outputs.file_name }}' @@ -115,4 +121,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: ${{ steps.vars.outputs.artifact_name }}-${{ runner.os }}-${{ matrix.build-type }} - path: bin/${{ steps.vars.outputs.file_name }} + path: build/${{ steps.vars.outputs.file_name }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index dbf270c7f..64551cc26 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -36,12 +36,12 @@ jobs: - name: Update version run: | - (Get-Content src\Notes.pro) -Replace '^VERSION *= *(.+)$',"`$0-g$($env:GITHUB_SHA.Substring(0,7))" | Set-Content src\Notes.pro + (Get-Content CMakeLists.txt) -Replace ("PROJECT_VERSION *[^)]+", "`$0-g$($env:GITHUB_SHA.Substring(0,7))") | Set-Content CMakeLists.txt - name: Setup variables id: vars run: | - $version = Select-String -Path src\Notes.pro -Pattern '^VERSION *= *(.+)$' | %{$_.Matches.Groups[1].value} + $version = Select-String -Path CMakeLists.txt -Pattern 'PROJECT_VERSION *([^)]+)' | %{$_.Matches.Groups[1].value} $artifact_name = "Notes_$version-${{ matrix.arch }}-Qt${{ matrix.qt-version }}" Write-Output "version=$version" >> $env:GITHUB_OUTPUT Write-Output "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT @@ -64,18 +64,16 @@ jobs: - name: Build (${{ matrix.build-type }}, ${{ matrix.arch }}) run: | - New-Item build -ItemType Directory - Set-Location build - qmake -config ${{ matrix.build-type }} ..\src\Notes.pro - nmake + cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} + cmake --build build - name: Deploy (${{ matrix.build-type }}, ${{ matrix.arch }}) run: | - windeployqt bin + windeployqt build - name: Include required runtime libraries (${{ matrix.build-type }}, ${{ matrix.arch }}) run: | - Set-Location bin + Set-Location build if ('${{ matrix.arch }}' -ieq 'x64') { $openssl_lib_suffix = '-x64' @@ -114,7 +112,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: ${{ steps.vars.outputs.artifact_name }}-${{ runner.os }}-${{ matrix.build-type }} - path: bin + path: build unified-installer: name: Unified x64-x86 Installer (Qt 5 only) diff --git a/.gitignore b/.gitignore index 7be9d42d2..119ca6db6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ bin* ###################### .DS_Store* .vscode/ +.cache/ ehthumbs.db Thumbs.db Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..9bf4d5853 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,186 @@ +cmake_minimum_required(VERSION 3.10) +project(notes LANGUAGES CXX) +set (PROJECT_VERSION 2.0.0) +set (CMAKE_CXX_STANDARD 14) +set (CMAKE_CXX_STANDARD_REQUIRED ON) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") +endif() + +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}") + +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) + +if (NOT DEFINED QT_VERSION_MAJOR) + # message(FATAL_ERROR "Qt not found.") + message("Qt not found.") +else() + message("Using QT_VERSION_MAJOR: ${QT_VERSION_MAJOR}") +endif() + +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Concurrent Gui Network Sql Widgets Test) + +set (GENERAL_PROJECT_SOURCES + ${PROJECT_SOURCE_DIR}/src/aboutwindow.cpp + ${PROJECT_SOURCE_DIR}/src/allnotebuttontreedelegateeditor.cpp + ${PROJECT_SOURCE_DIR}/src/customapplicationstyle.cpp + ${PROJECT_SOURCE_DIR}/src/customdocument.cpp + ${PROJECT_SOURCE_DIR}/src/dbmanager.cpp + ${PROJECT_SOURCE_DIR}/src/defaultnotefolderdelegateeditor.cpp + ${PROJECT_SOURCE_DIR}/src/editorsettingsbutton.cpp + ${PROJECT_SOURCE_DIR}/src/elidedlabel.cpp + ${PROJECT_SOURCE_DIR}/src/foldertreedelegateeditor.cpp + ${PROJECT_SOURCE_DIR}/src/labeledittype.cpp + ${PROJECT_SOURCE_DIR}/src/listviewlogic.cpp + ${PROJECT_SOURCE_DIR}/src/main.cpp + ${PROJECT_SOURCE_DIR}/src/mainwindow.cpp + ${PROJECT_SOURCE_DIR}/src/nodedata.cpp + ${PROJECT_SOURCE_DIR}/src/nodepath.cpp + ${PROJECT_SOURCE_DIR}/src/nodetreedelegate.cpp + ${PROJECT_SOURCE_DIR}/src/nodetreemodel.cpp + ${PROJECT_SOURCE_DIR}/src/nodetreeview.cpp + ${PROJECT_SOURCE_DIR}/src/noteeditorlogic.cpp + ${PROJECT_SOURCE_DIR}/src/notelistdelegate.cpp + ${PROJECT_SOURCE_DIR}/src/notelistdelegateeditor.cpp + ${PROJECT_SOURCE_DIR}/src/notelistmodel.cpp + ${PROJECT_SOURCE_DIR}/src/notelistview.cpp + ${PROJECT_SOURCE_DIR}/src/pushbuttontype.cpp + ${PROJECT_SOURCE_DIR}/src/singleinstance.cpp + ${PROJECT_SOURCE_DIR}/src/splitterstyle.cpp + ${PROJECT_SOURCE_DIR}/src/styleeditorwindow.cpp + ${PROJECT_SOURCE_DIR}/src/tagdata.cpp + ${PROJECT_SOURCE_DIR}/src/taglistdelegate.cpp + ${PROJECT_SOURCE_DIR}/src/taglistmodel.cpp + ${PROJECT_SOURCE_DIR}/src/taglistview.cpp + ${PROJECT_SOURCE_DIR}/src/tagpool.cpp + ${PROJECT_SOURCE_DIR}/src/tagtreedelegateeditor.cpp + ${PROJECT_SOURCE_DIR}/src/trashbuttondelegateeditor.cpp + ${PROJECT_SOURCE_DIR}/src/treeviewlogic.cpp + ${PROJECT_SOURCE_DIR}/src/updaterwindow.cpp + # ui + ${PROJECT_SOURCE_DIR}/src/aboutwindow.ui + ${PROJECT_SOURCE_DIR}/src/mainwindow.ui + ${PROJECT_SOURCE_DIR}/src/styleeditorwindow.ui + ${PROJECT_SOURCE_DIR}/src/updaterwindow.ui + # 3rdParty ui + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/qplaintexteditsearchwidget.ui + ${PROJECT_SOURCE_DIR}/3rdParty/QSimpleUpdater/src/Downloader.ui + # 3rdParty source files + ${PROJECT_SOURCE_DIR}/3rdParty/qautostart/src/qautostart.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/qautostart/src/qautostart.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/markdownhighlighter.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/qmarkdowntextedit.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/qownlanguagedata.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/qplaintexteditsearchwidget.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/QSimpleUpdater/src/Downloader.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/QSimpleUpdater/src/QSimpleUpdater.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/QSimpleUpdater/src/Updater.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/qxt/qxtglobal.cpp + ${PROJECT_SOURCE_DIR}/3rdParty/qxt/qxtglobalshortcut.cpp + # qrc files + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/media.qrc + ${PROJECT_SOURCE_DIR}/3rdParty/QSimpleUpdater/etc/resources/qsimpleupdater.qrc + ${PROJECT_SOURCE_DIR}/src/fonts.qrc + ${PROJECT_SOURCE_DIR}/src/images.qrc + ${PROJECT_SOURCE_DIR}/src/styles.qrc +) + +file (GLOB_RECURSE HEADERS + ${PROJECT_SOURCE_DIR}/3rdParty/qautostart/qautostart.h + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/linenumberarea.h + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/markdownhighlighter.h + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/qmarkdowntextedit.h + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/qownlanguagedata.h + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit/qplaintexteditsearchwidget.h + ${PROJECT_SOURCE_DIR}/3rdParty/QSimpleUpdater/include/*.h + ${PROJECT_SOURCE_DIR}/3rdParty/QSimpleUpdater/src/*.h + ${PROJECT_SOURCE_DIR}/3rdParty/qxt/*.h + ${PROJECT_SOURCE_DIR}/src/*.h +) + +set (MACX_PROJECT_SOURCES + ${PROJECT_SOURCE_DIR}/3rdParty/qxt/qxtglobalshortcut_mac.cpp + ${PROJECT_SOURCE_DIR}/src/framelesswindow.mm +) + +set (WIN32_PROJECT_SOURCES + ${PROJECT_SOURCE_DIR}/3rdParty/qxt/qxtglobalshortcut_win.cpp + ${PROJECT_SOURCE_DIR}/src/framelesswindow.cpp +) + +set (LINUX_PROJECT_SOURCES + ${PROJECT_SOURCE_DIR}/3rdParty/qxt/qxtglobalshortcut_x11.cpp +) + + +add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE ${GENERAL_PROJECT_SOURCES} ${HEADERS}) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${PROJECT_SOURCE_DIR}/src/ + ${PROJECT_SOURCE_DIR}/3rdParty/QSimpleUpdater/include + ${PROJECT_SOURCE_DIR}/3rdParty/qautostart/src + ${PROJECT_SOURCE_DIR}/3rdParty/qmarkdowntextedit + ${PROJECT_SOURCE_DIR}/3rdParty/qxt +) + +target_compile_definitions(${PROJECT_NAME} PUBLIC + APP_VERSION="2.0.0" + QSU_INCLUDE_MOC=1 + QT_DISABLE_DEPRECATED_BEFORE=0x050900 +) + + +target_link_libraries(${PROJECT_NAME} PUBLIC + Qt${QT_VERSION_MAJOR}::Concurrent + Qt${QT_VERSION_MAJOR}::Core + Qt${QT_VERSION_MAJOR}::CorePrivate + Qt${QT_VERSION_MAJOR}::Gui + Qt${QT_VERSION_MAJOR}::GuiPrivate + Qt${QT_VERSION_MAJOR}::Network + Qt${QT_VERSION_MAJOR}::Sql + Qt${QT_VERSION_MAJOR}::Widgets + Qt${QT_VERSION_MAJOR}::WidgetsPrivate +) + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + target_sources(${PROJECT_NAME} PUBLIC ${MACX_PROJECT_SOURCES}) + + target_link_libraries(${PROJECT_NAME} PUBLIC + "-framework Carbon" + "-framework Cocoa" + ) +elseif(UNIX) + target_sources(${PROJECT_NAME} PUBLIC ${LINUX_PROJECT_SOURCES}) + + target_link_libraries(${PROJECT_NAME} PUBLIC + X11 + ) +elseif (WIN32) + target_sources(${PROJECT_NAME} PUBLIC ${WIN32_PROJECT_SOURCES}) + + target_compile_definitions(${PROJECT_NAME} PUBLIC + QXT_STATIC + ) + + target_link_libraries(${PROJECT_NAME} PUBLIC + user32 + ) + + # windows outputs to build/ folder for some reason + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") +endif() + + + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/Project.pro b/Project.pro deleted file mode 100644 index cf1c0d669..000000000 --- a/Project.pro +++ /dev/null @@ -1,35 +0,0 @@ -# Taken from Qt Creator project files -defineTest(minQtVersion) { - maj = $$1 - min = $$2 - patch = $$3 - isEqual(QT_MAJOR_VERSION, $$maj) { - isEqual(QT_MINOR_VERSION, $$min) { - isEqual(QT_PATCH_VERSION, $$patch) { - return(true) - } - greaterThan(QT_PATCH_VERSION, $$patch) { - return(true) - } - } - greaterThan(QT_MINOR_VERSION, $$min) { - return(true) - } - } - greaterThan(QT_MAJOR_VERSION, $$maj) { - return(true) - } - return(false) -} - -!minQtVersion(5, 9, 0) { - message("Cannot build Notes with Qt version $${QT_VERSION}") - error("Use at least Qt 5.9.0.") -} - -TEMPLATE = subdirs -SUBDIRS = src -CONFIG += ordered - -src.file = src/Notes.pro -tests.depends = src diff --git a/README.md b/README.md index ce2d6d0d1..50fd2499b 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Make sure the Qt (>= 5.9) development libraries are installed: ```shell $> mkdir build $> cd build -$> qmake ../src +$> cmake .. -DCMAKE_BUILD_TYPE=Release $> make -j4 ``` diff --git a/src/Notes.pro b/src/Notes.pro deleted file mode 100755 index 29bb7d4f2..000000000 --- a/src/Notes.pro +++ /dev/null @@ -1,204 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2014-08-08T10:38:29 -# -#------------------------------------------------- - -VERSION = 2.0.0 - -QT += core gui widgets network sql -QT += core-private gui-private widgets-private -QT += concurrent - -TARGET = Notes -TEMPLATE = app -CONFIG += c++14 - -UI_DIR = uic -MOC_DIR = moc -RCC_DIR = qrc -OBJECTS_DIR = obj - -include ($$PWD/../3rdParty/qxt/qxt.pri) -include ($$PWD/../3rdParty/QSimpleUpdater/QSimpleUpdater.pri) -include ($$PWD/../3rdParty/qmarkdowntextedit/qmarkdowntextedit.pri) -include ($$PWD/../3rdParty/qautostart/src/qautostart.pri) - -DEFINES += APP_VERSION=\\\"$$VERSION\\\" \ - QT_DISABLE_DEPRECATED_BEFORE=0x050900 - -SOURCES += \ - allnotebuttontreedelegateeditor.cpp \ - customapplicationstyle.cpp \ - defaultnotefolderdelegateeditor.cpp \ - elidedlabel.cpp \ - main.cpp\ - mainwindow.cpp \ - noteeditorlogic.cpp \ - notelistdelegate.cpp \ - notelistdelegateeditor.cpp \ - notelistmodel.cpp \ - notelistview.cpp \ - singleinstance.cpp \ - splitterstyle.cpp \ - taglistdelegate.cpp \ - taglistmodel.cpp \ - taglistview.cpp \ - tagpool.cpp \ - tagtreedelegateeditor.cpp \ - trashbuttondelegateeditor.cpp \ - updaterwindow.cpp \ - dbmanager.cpp \ - aboutwindow.cpp \ - customdocument.cpp \ - editorsettingsbutton.cpp \ - foldertreedelegateeditor.cpp \ - labeledittype.cpp \ - listviewlogic.cpp \ - nodedata.cpp \ - nodepath.cpp \ - nodetreedelegate.cpp \ - nodetreemodel.cpp \ - nodetreeview.cpp \ - pushbuttontype.cpp \ - styleeditorwindow.cpp \ - tagdata.cpp \ - treeviewlogic.cpp - -HEADERS += \ - allnotebuttontreedelegateeditor.h \ - customapplicationstyle.h \ - defaultnotefolderdelegateeditor.h \ - elidedlabel.h \ - mainwindow.h \ - nodetreeview_p.h \ - noteeditorlogic.h \ - notelistdelegate.h \ - notelistdelegateeditor.h \ - notelistmodel.h \ - notelistview.h \ - notelistview_p.h \ - singleinstance.h \ - splitterstyle.h \ - taglistdelegate.h \ - taglistmodel.h \ - taglistview.h \ - tagpool.h \ - tagtreedelegateeditor.h \ - trashbuttondelegateeditor.h \ - updaterwindow.h \ - dbmanager.h \ - aboutwindow.h \ - customDocument.h \ - editorsettingsbutton.h \ - foldertreedelegateeditor.h \ - framelesswindow.h \ - labeledittype.h \ - listviewlogic.h \ - nodedata.h \ - nodepath.h \ - nodetreedelegate.h \ - nodetreemodel.h \ - nodetreeview.h \ - pushbuttontype.h \ - styleeditorwindow.h \ - tagdata.h \ - treeviewlogic.h - -FORMS += \ - $$PWD/mainwindow.ui \ - $$PWD/updaterwindow.ui \ - aboutwindow.ui \ - styleeditorwindow.ui - -RESOURCES += \ - $$PWD/images.qrc \ - $$PWD/fonts.qrc \ - $$PWD/styles.qrc - -linux:!android { - isEmpty (PREFIX) { - PREFIX = /usr - } - - BINDIR = $$PREFIX/bin - - target.path = $$BINDIR - icon.path = $$PREFIX/share/pixmaps - desktop.path = $$PREFIX/share/applications - icon.files += $$PWD/packaging/linux/common/notes.png - desktop.files += $$PWD/packaging/linux/common/notes.desktop - - TARGET = notes - INSTALLS += target desktop icon - - # SNAP -------------------------------------------------------------------------------- - snap_pack.commands = snapcraft clean && snapcraft - - # Debian ------------------------------------------------------------------------------- - - License = gpl2 - Project = "$$TARGET-$$VERSION" - - AuthorEmail = \"awesomeness.notes@gmail.com\" - AuthorName = \"Ruby Mamistvalove\" - - deb.target = deb - deb.depends = fix_deb_dependencies - deb.depends += $$TARGET - deb.commands = rm -rf deb &&\ - mkdir -p deb/$$Project &&\ - cp $$TARGET deb/$$Project &&\ - cp $$_PRO_FILE_PWD_/../packaging/linux/common/LICENSE deb/$$Project/license.txt &&\ - cp -a $$_PRO_FILE_PWD_/../packaging/linux/common/icons deb/$$Project/ &&\ - cp $$_PRO_FILE_PWD_/../packaging/linux/common/notes.desktop deb/$$Project/notes.desktop &&\ - cp $$_PRO_FILE_PWD_/../packaging/linux/debian/copyright deb/$$Project/copyright &&\ - cp -avr $$_PRO_FILE_PWD_/../packaging/linux/debian deb/$$Project/debian &&\ - cd deb/$$Project/ &&\ - DEBFULLNAME=$$AuthorName EMAIL=$$AuthorEmail dh_make -y -s -c $$License --createorig; \ - dpkg-buildpackage -uc -us - - fix_deb_dependencies.commands = \ - sed -i -- 's/5.2/$$QT_MAJOR_VERSION\.$$QT_MINOR_VERSION/g' $$_PRO_FILE_PWD_/../packaging/linux/debian/control - - # AppImage ------------------------------------------------------------------------------- - - appimage.target = appimage - appimage.depends = $$TARGET - appimage.commands = mkdir -p Notes/usr/bin; - appimage.commands += cp $$TARGET Notes/usr/bin; - appimage.commands += mkdir -p Notes/usr/share/applications/; - appimage.commands += cp $$_PRO_FILE_PWD_/../packaging/linux/common/notes.desktop Notes/usr/share/applications/; - appimage.commands += cp $$_PRO_FILE_PWD_/../packaging/linux/common/icons/256x256/notes.png Notes; - appimage.commands += mkdir -p Notes/usr/share/icons/default/256x256/apps/; - appimage.commands += cp $$_PRO_FILE_PWD_/../packaging/linux/common/icons/256x256/notes.png Notes/usr/share/icons/default/256x256/apps/; - appimage.commands += wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"; - appimage.commands += chmod a+x linuxdeployqt*.AppImage; - appimage.commands += unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH; - appimage.commands += ./linuxdeployqt*.AppImage Notes/usr/share/applications/*.desktop -bundle-non-qt-libs; - appimage.commands += cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 Notes/usr/lib; - appimage.commands += ./linuxdeployqt*.AppImage Notes/usr/share/applications/*.desktop -appimage; - appimage.commands += find Notes -executable -type f -exec ldd {} \; | grep \" => /usr\" | cut -d \" \" -f 2-3 | sort | uniq; - - # EXTRA -------------------------------------------------------------------------------- - QMAKE_EXTRA_TARGETS += \ - snap_pack \ - deb \ - fix_deb_dependencies \ - appimage -} - -macx { - DESTDIR = $$PWD/../bin - ICON = $$PWD/images\notes_icon.icns - OBJECTIVE_SOURCES += \ - framelesswindow.mm - LIBS += -framework Cocoa -} - -win32 { - DESTDIR = $$PWD/../bin - RC_FILE = $$PWD/images\notes.rc - SOURCES += \ - framelesswindow.cpp -}