-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: #61
- Loading branch information
Showing
21 changed files
with
245 additions
and
285 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
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,104 +1,94 @@ | ||
# Translations | ||
file(GLOB LiriText_TRANSLATIONS "${CMAKE_SOURCE_DIR}/translations/app/*_*.ts") | ||
qt5_add_translation(LiriText_QM_FILES ${LiriText_TRANSLATIONS}) | ||
if(WIN32) | ||
set(_translations_destdir "${CMAKE_CURRENT_BINARY_DIR}/translations") | ||
elseif(APPLE) | ||
set(_translations_destdir "${CMAKE_CURRENT_BINARY_DIR}/Contents/Resources/data/translations") | ||
elseif(LINUX OR BSD) | ||
set(_translations_destdir "${INSTALL_DATADIR}/liri-text/translations") | ||
endif() | ||
if(DEFINED _translations_destdir) | ||
install(FILES ${LiriText_QM_FILES} DESTINATION "${_translations_destdir}") | ||
endif() | ||
|
||
set(LiriText_ICON "${CMAKE_CURRENT_SOURCE_DIR}/../data/icons/io.liri.Text.icns") | ||
set_source_files_properties("${LiriText_ICON}" PROPERTIES | ||
MACOSX_PACKAGE_LOCATION "Resources" | ||
) | ||
|
||
set(LiriText_RC "${CMAKE_CURRENT_SOURCE_DIR}/../data/io.liri.Text.rc") | ||
|
||
qt_add_executable(LiriText | ||
WIN32 MACOSX_BUNDLE | ||
documenthandler.cpp documenthandler.h | ||
highlightdata.cpp highlightdata.h | ||
historymanager.cpp historymanager.h | ||
languagecontextbase.cpp languagecontextbase.h | ||
languagecontextcontainer.cpp languagecontextcontainer.h | ||
languagecontext.cpp languagecontext.h | ||
languagecontextkeyword.cpp languagecontextkeyword.h | ||
languagecontextreference.cpp languagecontextreference.h | ||
languagecontextsimple.cpp languagecontextsimple.h | ||
languagecontextsubpattern.cpp languagecontextsubpattern.h | ||
languagedatabasemaintainer.cpp languagedatabasemaintainer.h | ||
languagedefaultstyles.cpp languagedefaultstyles.h | ||
languageloader.cpp languageloader.h | ||
languagemanager.cpp languagemanager.h | ||
languagemetadata.h | ||
lirisyntaxhighlighter.cpp lirisyntaxhighlighter.h | ||
main.cpp | ||
${LiriText_ICON} | ||
${LiriText_RC} | ||
) | ||
|
||
qt_add_qml_module(LiriText | ||
URI LiriText | ||
VERSION 2.0 | ||
QML_FILES | ||
qml/EditPage.qml | ||
qml/FileGridView.qml | ||
qml/Main.qml | ||
qml/RecentFilesPage.qml | ||
qml/SearchOverlay.qml | ||
RESOURCES | ||
resources/icon.png | ||
) | ||
|
||
file(GLOB ts_files "../translations/app/*.ts") | ||
qt_add_translations(LiriText | ||
TS_FILES ${ts_files} | ||
RESOURCE_PREFIX /qt/qml/LiriText/i18n | ||
) | ||
|
||
target_compile_definitions(LiriText PRIVATE | ||
#QT_NO_CAST_FROM_ASCII | ||
#QT_NO_FOREACH | ||
-DTEXT_VERSION="${PROJECT_VERSION}" | ||
-DUSER_LANGUAGE_PATH="/language-specs/" | ||
-DLANGUAGE_DB_VERSION=1 | ||
) | ||
|
||
if(WIN32) | ||
set(LiriText_DEFINES -DRELATIVE_LANGUAGE_PATH="/language-specs/") | ||
target_compile_definitions(LiriText PRIVATE -DRELATIVE_LANGUAGE_PATH="/language-specs/") | ||
elseif(APPLE) | ||
set(LiriText_DEFINES -DRELATIVE_LANGUAGE_PATH="../Resources/data/language-specs/") | ||
target_compile_definitions(LiriText PRIVATE -DRELATIVE_LANGUAGE_PATH="../Resources/data/language-specs/") | ||
else() | ||
set(LiriText_DEFINES -DABSOLUTE_LANGUAGE_PATH="${CMAKE_INSTALL_PREFIX}/${INSTALL_DATADIR}/liri-text/language-specs/") | ||
target_compile_definitions(LiriText PRIVATE -DABSOLUTE_LANGUAGE_PATH="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/liri-text/language-specs/") | ||
endif() | ||
|
||
target_link_libraries(LiriText | ||
PRIVATE | ||
Qt6::Core | ||
Qt6::Core5Compat | ||
Qt6::Gui | ||
Qt6::Widgets | ||
Qt6::Qml | ||
Qt6::Quick | ||
Qt6::QuickControls2 | ||
Qt6::Sql | ||
) | ||
|
||
if(APPLE OR WIN32) | ||
set(LiriText_OUTPUT_NAME "LiriText") | ||
set_target_properties(LiriText PROPERTIES OUTPUT_NAME "LiriText") | ||
else() | ||
set(LiriText_OUTPUT_NAME "liri-text") | ||
set_target_properties(LiriText PROPERTIES OUTPUT_NAME "liri-text") | ||
endif() | ||
if(APPLE) | ||
set_target_properties(LiriText PROPERTIES | ||
MACOSX_BUNDLE_GUI_IDENTIFIER "io.liri.Text" | ||
MACOSX_BUNDLE_ICON_FILE "io.liri.Text" | ||
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}" | ||
) | ||
endif() | ||
|
||
liri_add_executable(LiriText | ||
OUTPUT_NAME | ||
"${LiriText_OUTPUT_NAME}" | ||
SOURCES | ||
documenthandler.cpp | ||
documenthandler.h | ||
highlightdata.cpp | ||
highlightdata.h | ||
historymanager.cpp | ||
historymanager.h | ||
languagecontextbase.cpp | ||
languagecontextbase.h | ||
languagecontextcontainer.cpp | ||
languagecontextcontainer.h | ||
languagecontext.cpp | ||
languagecontext.h | ||
languagecontextkeyword.cpp | ||
languagecontextkeyword.h | ||
languagecontextreference.cpp | ||
languagecontextreference.h | ||
languagecontextsimple.cpp | ||
languagecontextsimple.h | ||
languagecontextsubpattern.cpp | ||
languagecontextsubpattern.h | ||
languagedatabasemaintainer.cpp | ||
languagedatabasemaintainer.h | ||
languagedefaultstyles.cpp | ||
languagedefaultstyles.h | ||
languageloader.cpp | ||
languageloader.h | ||
languagemanager.cpp | ||
languagemanager.h | ||
languagemetadata.h | ||
lirisyntaxhighlighter.cpp | ||
lirisyntaxhighlighter.h | ||
main.cpp | ||
${LiriText_ICON} | ||
${LiriText_RC} | ||
${LiriText_QM_FILES} | ||
RESOURCES | ||
text.qrc | ||
DEFINES | ||
#QT_NO_CAST_FROM_ASCII | ||
#QT_NO_FOREACH | ||
-DTEXT_VERSION="${PROJECT_VERSION}" | ||
-DUSER_LANGUAGE_PATH="/language-specs/" | ||
-DLANGUAGE_DB_VERSION=1 | ||
${LiriText_DEFINES} | ||
APPDATA | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../data/io.liri.Text.appdata.xml" | ||
DESKTOP | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../data/io.liri.Text.desktop" | ||
LIBRARIES | ||
Qt5::Core | ||
Qt5::Gui | ||
Qt5::Widgets | ||
Qt5::Qml | ||
Qt5::Quick | ||
Qt5::QuickControls2 | ||
Qt5::Sql | ||
GUI | ||
install(TARGETS LiriText | ||
BUNDLE DESTINATION . | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
) | ||
set_target_properties(LiriText PROPERTIES | ||
MACOSX_BUNDLE_GUI_IDENTIFIER "io.liri.Text" | ||
MACOSX_BUNDLE_ICON_FILE "io.liri.Text" | ||
MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}" | ||
) | ||
|
||
liri_finalize_executable(LiriText) |
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
Oops, something went wrong.