-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
5 changed files
with
140 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
cmake_minimum_required (VERSION 3.12) | ||
project(VNote VERSION 3.17.0 LANGUAGES C CXX) | ||
project(VNote | ||
VERSION 3.17.0 | ||
DESCRIPTION "A pleasant note-taking platform" | ||
HOMEPAGE_URL "https://app.vnote.fun" | ||
LANGUAGES C CXX) | ||
|
||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type, defaults to Release") | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_AUTORCC ON) | ||
|
||
set(QHOTKEY_INSTALL OFF CACHE BOOL "Disable installing QHotKey" FORCE) | ||
add_subdirectory(libs) | ||
|
||
add_subdirectory(src) | ||
|
||
# TODO: find a better way to organize tests | ||
# add_subdirectory(tests) |
Submodule vtextedit
updated
5 files
+1 −1 | libs/hunspell | |
+0 −6 | libs/katevi/CMakeLists.txt | |
+0 −6 | libs/peg-markdown-highlight/CMakeLists.txt | |
+1 −1 | libs/sonnet | |
+1 −1 | libs/syntax-highlighting |
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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# from: https://github.com/miurahr/cmake-qt-packaging-example | ||
|
||
find_package(Qt${QT_DEFAULT_MAJOR_VERSION} REQUIRED COMPONENTS Core) | ||
|
||
get_target_property(QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION) | ||
get_filename_component(QT_BIN_DIR "${QMAKE_EXECUTABLE}" DIRECTORY) | ||
execute_process(COMMAND ${QMAKE_EXECUTABLE} -query QT_VERSION OUTPUT_VARIABLE QT_VERSION) | ||
|
||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}") | ||
find_program(LINUXDEPLOY_EXECUTABLE linuxdeploy linuxdeploy-x86_64.AppImage HINTS "${QT_BIN_DIR}") | ||
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}") | ||
find_program(MACDEPLOYQTFIX_EXECUTABLE macdeployqtfix.py HINTS "${QT_BIN_DIR}") | ||
find_package(Python) | ||
|
||
mark_as_advanced(WINDEPLOYQT_EXECUTABLE LINUXDEPLOY_EXECUTABLE MACDEPLOYQT_EXECUTABLE) | ||
|
||
function(windeployqt target) | ||
# Bundle Library Files | ||
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER) | ||
|
||
if(CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG") | ||
set(WINDEPLOYQT_ARGS --debug) | ||
else() | ||
set(WINDEPLOYQT_ARGS --release) | ||
endif() | ||
|
||
add_custom_target(deploy | ||
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/" | ||
COMMAND "${CMAKE_COMMAND}" -E | ||
env PATH="${QT_BIN_DIR}" "${WINDEPLOYQT_EXECUTABLE}" | ||
${WINDEPLOYQT_ARGS} | ||
--verbose 0 | ||
--no-quick-import | ||
--no-opengl-sw | ||
--no-compiler-runtime | ||
--translations zh_CN,ja | ||
--dir "${CMAKE_CURRENT_BINARY_DIR}/winqt/" | ||
$<TARGET_FILE:${target}> | ||
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/generic/" | ||
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/styles/" | ||
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/qmltooling/" | ||
COMMENT "Deploying Qt..." | ||
DEPENDS vnote | ||
) | ||
|
||
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/winqt/" DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE) | ||
include(InstallRequiredSystemLibraries) | ||
endfunction() | ||
|
||
set(CPACK_PACKAGE_VENDOR "VNoteX") | ||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) | ||
set(CPACK_PACKAGE_CONTACT "Le Tan <[email protected]>") | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}") | ||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md") | ||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING.LESSER") | ||
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | ||
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) | ||
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) | ||
|
||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}") | ||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}") | ||
|
||
# Start menu entry on Windows | ||
set(CPACK_PACKAGE_EXECUTABLES "vnote" "VNote") | ||
# Desktop link on Windows | ||
set(CPACK_CREATE_DESKTOP_LINKS "vnote") | ||
|
||
set(CPACK_STRIP_FILES TRUE) | ||
|
||
# WIX generator | ||
set(CPACK_WIX_UPGRADE_GUID BA25F337-991A-4893-9D8A-AD5E89BAF5C4) | ||
set(CPACK_WIX_PRODUCT_GUID BA25F337-991A-4893-9D8A-AD5E89BAF5C4) | ||
set(CPACK_WIX_LICENSE_RTF "${PROJECT_SOURCE_DIR}/package/lgpl-3.0.rtf") | ||
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_LIST_DIR}/data/core/icons/vnote.ico") | ||
set(CPACK_WIX_UI_BANNER "${PROJECT_SOURCE_DIR}/package/wix_banner.png") | ||
set(CPACK_WIX_UI_DIALOG "${PROJECT_SOURCE_DIR}/package/wix_dialog.png") | ||
|
||
#------------------------------------------------------------------------------ | ||
# include CPack, so we get target for packages | ||
set(CPACK_OUTPUT_CONFIG_FILE "${CMAKE_BINARY_DIR}/BundleConfig.cmake") | ||
|
||
add_custom_target(pack | ||
COMMAND ${CMAKE_CPACK_COMMAND} "--config" "${CMAKE_BINARY_DIR}/BundleConfig.cmake" | ||
COMMENT "Running CPACK. Please wait..." | ||
DEPENDS vnote) | ||
set(CPACK_GENERATOR) | ||
|
||
if (WIN32) | ||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}" DOC "Path to the windeployqt utility") | ||
|
||
list(APPEND CPACK_GENERATOR ZIP) | ||
message(STATUS "Package generation - Windows - Zip") | ||
|
||
find_program(WIX_EXECUTABLE wix HINTS "${QT_BIN_DIR}" DOC "Path to the WiX utility") | ||
|
||
if (NOT WIX_EXECUTABLE-NOTFOUND) | ||
list(APPEND CPACK_GENERATOR WIX) | ||
message(STATUS "Package generation - Windows - WiX") | ||
endif() | ||
|
||
windeployqt(vnote) | ||
endif() | ||
|
||
include(CPack) |
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