-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
231 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ bin* | |
###################### | ||
.DS_Store* | ||
.vscode/ | ||
.cache/ | ||
ehthumbs.db | ||
Thumbs.db | ||
Makefile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/<Debug/Release> 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}" | ||
) |
Oops, something went wrong.