mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-09-17 13:37:18 +03:00
Merge pull request #397 from Murmele/fixCmakeInstallationPaths
Fix cmake installation paths
This commit is contained in:
commit
75e2e38f5d
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -314,7 +314,7 @@ jobs:
|
||||
uses: GabrielBB/xvfb-action@v1
|
||||
with:
|
||||
working-directory: build/release
|
||||
run: ninja check
|
||||
run: ninja check --verbose
|
||||
|
||||
- name: Test (Windows)
|
||||
if: matrix.env.ninja_platform == 'win'
|
||||
|
@ -3,6 +3,8 @@ project(Gittyup)
|
||||
|
||||
# Set name and version.
|
||||
set(GITTYUP_NAME "Gittyup")
|
||||
set(GITTYUP_EXECUTABLE_NAME "gittyup")
|
||||
set(GITTYUP_IDENTIFIER "com.github.Murmele.Gittyup")
|
||||
set(GITTYUP_VERSION_MAJOR 1)
|
||||
set(GITTYUP_VERSION_MINOR 2)
|
||||
set(GITTYUP_VERSION_PATCH 2)
|
||||
@ -135,6 +137,18 @@ if(APPLE)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(CONTENTS_DIR ${GITTYUP_EXECUTABLE_NAME}.app/Contents)
|
||||
set(RESOURCES_DIR ${CONTENTS_DIR}/Resources)
|
||||
set(L10N_INSTALL_DIR ${RESOURCES_DIR}/l10n)
|
||||
elseif(UNIX)
|
||||
set(L10N_INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${GITTYUP_NAME})
|
||||
set(RESOURCES_DIR ${CMAKE_INSTALL_DATADIR}/${GITTYUP_NAME})
|
||||
else()
|
||||
set(L10N_INSTALL_DIR Resources/l10n)
|
||||
set(RESOURCES_DIR Resources)
|
||||
endif()
|
||||
|
||||
add_subdirectory(dep)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(l10n)
|
||||
|
@ -59,5 +59,8 @@ target_link_libraries(scintilla Qt5::Widgets lexilla)
|
||||
set_target_properties(scintilla PROPERTIES AUTOMOC ON)
|
||||
|
||||
set(SCINTILLUA_LEXERS_DIR
|
||||
${RESOURCES_DIR}/lexers
|
||||
CACHE INTERNAL "")
|
||||
set(SRC_SCINTILLUA_LEXERS_DIR
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/scintillua/lexers
|
||||
CACHE INTERNAL "")
|
||||
|
@ -11,6 +11,7 @@ Current unreleased version
|
||||
|
||||
* Fix external diff with Flatpak
|
||||
* Fix storing repository settings correctly, because otherwise they are not applied
|
||||
* Fix language support. Languages can now be switched by adding LANG=<language> in front of the executable
|
||||
|
||||
----
|
||||
|
||||
|
@ -33,6 +33,25 @@ Remember to search for existing issues before creating a new one.
|
||||
If you still need help, check out our Matrix channel
|
||||
[Gittyup:martix.org](https://matrix.to/#/#Gittyup:matrix.org).
|
||||
|
||||
Multi language support
|
||||
======================
|
||||
|
||||
Gittyup supports the following languages:
|
||||
- English (en)
|
||||
- German (de)
|
||||
- Spanisch (es)
|
||||
- Japanese (ja)
|
||||
- Portuguese (pt)
|
||||
- Portuguese Brazil (pt_BR)
|
||||
- Chinese (zh_CN)
|
||||
- Russian (ru)
|
||||
|
||||
By default the system language is used. To switch to another language execute the application with the following command
|
||||
```
|
||||
LANG=<lang> <executable>
|
||||
```
|
||||
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
|
@ -29,11 +29,6 @@ add_custom_target(translations DEPENDS ${QM_FILES})
|
||||
add_dependencies(gittyup translations)
|
||||
|
||||
# install language files
|
||||
if(APPLE)
|
||||
set(CONTENTS_DIR ${GITTYUP_NAME}.app/Contents)
|
||||
elseif(UNIX)
|
||||
set(CONTENTS_DIR ${CMAKE_INSTALL_DATADIR}/gittyup)
|
||||
endif()
|
||||
|
||||
foreach(LANGUAGE ${LANGUAGES})
|
||||
set(QT_QM_FILES ${QT_QM_FILES} ${QT_TRANSLATIONS_DIR}/qtbase_${LANGUAGE}.qm)
|
||||
@ -44,19 +39,22 @@ foreach(LANGUAGE ${LANGUAGES})
|
||||
TARGET translations
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
${DIR}/${CONTENTS_DIR}/Resources/${LANGUAGE}.lproj)
|
||||
${DIR}/${RESOURCES_DIR}/${LANGUAGE}.lproj)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(APPLE OR UNIX)
|
||||
set(RESOURCES_PREFIX ${CONTENTS_DIR}/)
|
||||
endif()
|
||||
|
||||
foreach(QM_FILE ${QM_FILES} ${QT_QM_FILES})
|
||||
foreach(QM_FILE ${QT_QM_FILES})
|
||||
if(EXISTS ${QM_FILE})
|
||||
install(
|
||||
FILES ${QM_FILE}
|
||||
DESTINATION ${RESOURCES_PREFIX}Resources/l10n
|
||||
DESTINATION ${L10N_INSTALL_DIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(QM_FILE ${QM_FILES})
|
||||
install(
|
||||
FILES ${QM_FILE}
|
||||
DESTINATION ${L10N_INSTALL_DIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endforeach()
|
||||
|
@ -2,7 +2,6 @@ set(CONF_DIR ${CMAKE_SOURCE_DIR}/conf)
|
||||
set(RSRC_DIR ${CMAKE_SOURCE_DIR}/rsrc)
|
||||
|
||||
set(MAC $<PLATFORM_ID:Darwin>)
|
||||
set(CONTENTS_DIR ${GITTYUP_NAME}.app/Contents)
|
||||
|
||||
# Install Qt plugins.
|
||||
set(QT_PLUGINS QJpegPlugin)
|
||||
@ -17,6 +16,14 @@ else()
|
||||
QComposePlatformInputContextPlugin)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(INSTALL_LIBDIR ${CMAKE_INSTALL_BINDIR})
|
||||
elseif(NOT APPLE)
|
||||
set(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
else()
|
||||
set(INSTALL_LIBDIR ${CONTENTS_DIR})
|
||||
endif()
|
||||
|
||||
if(FLATPAK)
|
||||
qt_import_plugins(gittyup INCLUDE ${QT_PLUGINS})
|
||||
elseif(NOT USE_SYSTEM_QT)
|
||||
@ -35,7 +42,7 @@ elseif(NOT USE_SYSTEM_QT)
|
||||
|
||||
install(
|
||||
FILES ${PLUGIN}
|
||||
DESTINATION $<${MAC}:${CONTENTS_DIR}/>Plugins/${DIR_NAME}
|
||||
DESTINATION ${INSTALL_LIBDIR}/Plugins/${DIR_NAME}
|
||||
PERMISSIONS
|
||||
OWNER_READ
|
||||
OWNER_WRITE
|
||||
@ -100,7 +107,7 @@ elseif(NOT USE_SYSTEM_QT)
|
||||
|
||||
install(
|
||||
FILES ${QT_LIBRARY}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
DESTINATION ${INSTALL_LIBDIR}
|
||||
PERMISSIONS
|
||||
OWNER_READ
|
||||
OWNER_WRITE
|
||||
@ -166,7 +173,7 @@ if(NOT APPLE)
|
||||
|
||||
install(
|
||||
FILES ${SSL_LIB}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
DESTINATION ${INSTALL_LIBDIR}
|
||||
PERMISSIONS
|
||||
OWNER_READ
|
||||
OWNER_WRITE
|
||||
@ -186,16 +193,25 @@ if(NOT APPLE)
|
||||
set(QT_CONF ${CONF_DIR}/qt.conf)
|
||||
install(
|
||||
FILES ${QT_CONF}
|
||||
DESTINATION $<${MAC}:${CONTENTS_DIR}/Resources/>.
|
||||
DESTINATION
|
||||
$<${MAC}:${RESOURCES_DIR}>$<$<PLATFORM_ID:Windows>:${INSTALL_LIBDIR}>
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
foreach(icon 16 32 64 128 256 512)
|
||||
install(
|
||||
FILES ${RSRC_DIR}/Gittyup.iconset/icon_${icon}x${icon}.png
|
||||
DESTINATION share/icons/hicolor/${icon}x${icon}/apps
|
||||
COMPONENT ${GITTYUP_NAME}
|
||||
RENAME ${GITTYUP_EXECUTABLE_NAME}.png)
|
||||
endforeach()
|
||||
install(
|
||||
DIRECTORY ${RSRC_DIR}/Gittyup.iconset
|
||||
DESTINATION "Resources"
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
FILES ${RSRC_DIR}/Gittyup.iconset/gittyup_logo.svg
|
||||
DESTINATION share/icons/hicolor/scalable/apps
|
||||
COMPONENT ${GITTYUP_NAME}
|
||||
RENAME ${GITTYUP_EXECUTABLE_NAME}.svg)
|
||||
endif()
|
||||
|
||||
# Sign bundle on macOS.
|
||||
@ -204,7 +220,7 @@ if(APPLE AND CODESIGN_IDENTITY)
|
||||
CODE "execute_process(COMMAND
|
||||
codesign --deep --timestamp --options runtime
|
||||
-s \"${CODESIGN_IDENTITY}\"
|
||||
\${CMAKE_INSTALL_PREFIX}/${GITTYUP_NAME}.app
|
||||
\${CMAKE_INSTALL_PREFIX}/${GITTYUP_EXECUTABLE_NAME}.app
|
||||
)"
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endif()
|
||||
@ -220,9 +236,10 @@ elseif(WIN32)
|
||||
set(CPACK_NSIS_CREATE_ICONS_EXTRA
|
||||
"CreateShortCut \
|
||||
\\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${GITTYUP_NAME}.lnk\\\" \
|
||||
\\\"$INSTDIR\\\\${GITTYUP_NAME}.exe\\\"")
|
||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
||||
set(CPACK_NSIS_MUI_FINISHPAGE_RUN ${GITTYUP_NAME}.exe)
|
||||
\\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\${GITTYUP_EXECUTABLE_NAME}.exe\\\""
|
||||
)
|
||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ${CMAKE_INSTALL_BINDIR})
|
||||
set(CPACK_NSIS_MUI_FINISHPAGE_RUN ${GITTYUP_EXECUTABLE_NAME}.exe)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
install(
|
||||
@ -262,11 +279,11 @@ if(WIN32)
|
||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
|
||||
"${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
|
||||
WriteRegStr HKCR 'Directory\\\\Background\\\\shell\\\\Gittyup' '' 'Open with Gittyup'
|
||||
WriteRegStr HKCR 'Directory\\\\Background\\\\shell\\\\Gittyup' 'Icon' '\\\"$INSTDIR\\\\gittyup.exe\\\"'
|
||||
WriteRegStr HKCR 'Directory\\\\Background\\\\shell\\\\Gittyup\\\\command' '' '\\\"$INSTDIR\\\\gittyup.exe\\\" \\\"%V\\\"'
|
||||
WriteRegStr HKCR 'Directory\\\\Background\\\\shell\\\\Gittyup' 'Icon' '\\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\${GITTYUP_EXECUTABLE_NAME}.exe\\\"'
|
||||
WriteRegStr HKCR 'Directory\\\\Background\\\\shell\\\\Gittyup\\\\command' '' '\\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\${GITTYUP_EXECUTABLE_NAME}.exe\\\" \\\"%V\\\"'
|
||||
WriteRegStr HKCR 'Directory\\\\shell\\\\Gittyup' '' 'Open with Gittyup'
|
||||
WriteRegStr HKCR 'Directory\\\\shell\\\\Gittyup' 'Icon' '\\\"$INSTDIR\\\\gittyup.exe\\\"'
|
||||
WriteRegStr HKCR 'Directory\\\\shell\\\\Gittyup\\\\command' '' '\\\"$INSTDIR\\\\gittyup.exe\\\" \\\"%L\\\"'"
|
||||
WriteRegStr HKCR 'Directory\\\\shell\\\\Gittyup' 'Icon' '\\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\${GITTYUP_EXECUTABLE_NAME}.exe\\\"'
|
||||
WriteRegStr HKCR 'Directory\\\\shell\\\\Gittyup\\\\command' '' '\\\"$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\${GITTYUP_EXECUTABLE_NAME}.exe\\\" \\\"%L\\\"'"
|
||||
)
|
||||
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
|
||||
"${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
|
||||
@ -277,13 +294,18 @@ endif(WIN32)
|
||||
set(CPACK_PACKAGE_FILE_NAME ${PACKAGE_FILE_NAME})
|
||||
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}/pack)
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${GITTYUP_NAME})
|
||||
set(CPACK_PACKAGE_VENDOR "Scientific Toolworks, Inc.")
|
||||
set(CPACK_PACKAGE_VENDOR "Gittyup Contributors")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${GITTYUP_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${GITTYUP_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${GITTYUP_VERSION_PATCH})
|
||||
|
||||
if(WIN32)
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.md)
|
||||
else()
|
||||
install(
|
||||
FILES ${CMAKE_SOURCE_DIR}/LICENSE.md
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/Gittyup
|
||||
RENAME LICENSE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -16,6 +16,8 @@
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
72
rsrc/github-repository-open-graph-Gittyup.png.xmp
Normal file
72
rsrc/github-repository-open-graph-Gittyup.png.xmp
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
|
||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<rdf:Description rdf:about=""
|
||||
xmlns:exif="http://ns.adobe.com/exif/1.0/"
|
||||
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
|
||||
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
|
||||
xmlns:darktable="http://darktable.sf.net/"
|
||||
exif:DateTimeOriginal=""
|
||||
xmp:Rating="1"
|
||||
xmpMM:DerivedFrom="github-repository-open-graph-Gittyup.png"
|
||||
darktable:import_timestamp="63810317507625743"
|
||||
darktable:change_timestamp="-1"
|
||||
darktable:export_timestamp="-1"
|
||||
darktable:print_timestamp="-1"
|
||||
darktable:xmp_version="5"
|
||||
darktable:raw_params="0"
|
||||
darktable:auto_presets_applied="1"
|
||||
darktable:history_end="4"
|
||||
darktable:iop_order_version="2"
|
||||
darktable:history_basic_hash="adf93e2c7aefb698a6ff153e3fa7f0b8"
|
||||
darktable:history_current_hash="adf93e2c7aefb698a6ff153e3fa7f0b8">
|
||||
<darktable:masks_history>
|
||||
<rdf:Seq/>
|
||||
</darktable:masks_history>
|
||||
<darktable:history>
|
||||
<rdf:Seq>
|
||||
<rdf:li
|
||||
darktable:num="0"
|
||||
darktable:operation="colorin"
|
||||
darktable:enabled="1"
|
||||
darktable:modversion="7"
|
||||
darktable:params="gz48eJzjZBgFowABWAbaAaNgwAEAMNgADg=="
|
||||
darktable:multi_name=""
|
||||
darktable:multi_priority="0"
|
||||
darktable:blendop_version="11"
|
||||
darktable:blendop_params="gz14eJxjYIAACQYYOOHEgAZY0QVwggZ7CB6pfNoAAE8gGQg="/>
|
||||
<rdf:li
|
||||
darktable:num="1"
|
||||
darktable:operation="colorout"
|
||||
darktable:enabled="1"
|
||||
darktable:modversion="5"
|
||||
darktable:params="gz35eJxjZBgFo4CBAQAEEAAC"
|
||||
darktable:multi_name=""
|
||||
darktable:multi_priority="0"
|
||||
darktable:blendop_version="11"
|
||||
darktable:blendop_params="gz14eJxjYIAACQYYOOHEgAZY0QVwggZ7CB6pfNoAAE8gGQg="/>
|
||||
<rdf:li
|
||||
darktable:num="2"
|
||||
darktable:operation="gamma"
|
||||
darktable:enabled="1"
|
||||
darktable:modversion="1"
|
||||
darktable:params="0000000000000000"
|
||||
darktable:multi_name=""
|
||||
darktable:multi_priority="0"
|
||||
darktable:blendop_version="11"
|
||||
darktable:blendop_params="gz14eJxjYIAACQYYOOHEgAZY0QVwggZ7CB6pfNoAAE8gGQg="/>
|
||||
<rdf:li
|
||||
darktable:num="3"
|
||||
darktable:operation="flip"
|
||||
darktable:enabled="1"
|
||||
darktable:modversion="2"
|
||||
darktable:params="ffffffff"
|
||||
darktable:multi_name=""
|
||||
darktable:multi_priority="0"
|
||||
darktable:blendop_version="11"
|
||||
darktable:blendop_params="gz14eJxjYIAACQYYOOHEgAZY0QVwggZ7CB6pfNoAAE8gGQg="/>
|
||||
</rdf:Seq>
|
||||
</darktable:history>
|
||||
</rdf:Description>
|
||||
</rdf:RDF>
|
||||
</x:xmpmeta>
|
@ -45,7 +45,7 @@
|
||||
<url type="donation">https://liberapay.com/Gittyup/donate</url>
|
||||
|
||||
<provides>
|
||||
<binary>Gittyup</binary>
|
||||
<binary>gittyup</binary>
|
||||
<id>com.github.Murmele.Gittyup</id>
|
||||
</provides>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
Encoding=UTF-8
|
||||
Name=Gittyup
|
||||
Comment=Graphical Git client for Windows, Linux and macOS
|
||||
Exec=Gittyup
|
||||
Exec=gittyup
|
||||
StartupWMClass=com.github.Murmele.Gittyup
|
||||
Icon=gittyup
|
||||
Terminal=false
|
||||
|
@ -102,6 +102,19 @@ Application::Application(int &argc, char **argv, bool haltOnParseError)
|
||||
// Register types that are queued at runtime.
|
||||
qRegisterMetaType<git::Id>();
|
||||
|
||||
qDebug() << QString("Root dir: %1").arg(Settings::rootDir().absolutePath());
|
||||
qDebug() << QString("App dir: %1").arg(Settings::appDir().absolutePath());
|
||||
qDebug() << QString("Doc dir: %1").arg(Settings::docDir().absolutePath());
|
||||
qDebug() << QString("Conf dir: %1").arg(Settings::confDir().absolutePath());
|
||||
qDebug() << QString("l10n dir: %1").arg(Settings::l10nDir().absolutePath());
|
||||
qDebug() << QString("dictionaries dir: %1")
|
||||
.arg(Settings::dictionariesDir().absolutePath());
|
||||
qDebug() << QString("lexer dir: %1").arg(Settings::lexerDir().absolutePath());
|
||||
qDebug()
|
||||
<< QString("themes dir: %1").arg(Settings::themesDir().absolutePath());
|
||||
qDebug() << QString("pluginsDir dir: %1")
|
||||
.arg(Settings::pluginsDir().absolutePath());
|
||||
|
||||
// Connect updater signals.
|
||||
connect(Updater::instance(), &Updater::sslErrors, this,
|
||||
&Application::handleSslErrors);
|
||||
@ -310,9 +323,9 @@ static MainWindow *openOrSwitch(QDir repo) {
|
||||
}
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
#define DBUS_SERVICE_NAME "com.github.Murmele.Gittyup"
|
||||
#define DBUS_INTERFACE_NAME "com.github.Murmele.Gittyup.Application"
|
||||
#define DBUS_OBJECT_PATH "/com/github/Murmele/Gittyup/Application"
|
||||
#define DBUS_SERVICE_NAME GITTYUP_IDENTIFIER
|
||||
#define DBUS_INTERFACE_NAME GITTYUP_DBUS_INTERFACE_NAME
|
||||
#define DBUS_OBJECT_PATH GITTYUP_DBUS_OBJECT_PATH
|
||||
|
||||
DBusGittyup::DBusGittyup(QObject *parent) : QObject(parent) {}
|
||||
|
||||
@ -488,4 +501,4 @@ void Application::handleSslErrors(QNetworkReply *reply,
|
||||
reply->ignoreSslErrors(errors);
|
||||
settings.setValue("ssl/ignore", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ file(GLOB CONFIG_FILES ${CONF_DIR}/*.lua)
|
||||
file(GLOB DICTIONARIES ${CONF_DIR}/dictionaries/*.aff
|
||||
${CONF_DIR}/dictionaries/*.dic ${CONF_DIR}/dictionaries/*.txt)
|
||||
file(GLOB THEMES ${CONF_DIR}/themes/*.lua)
|
||||
file(GLOB SCINTILLUA_LEXERS ${SCINTILLUA_LEXERS_DIR}/*.lua)
|
||||
file(GLOB SCINTILLUA_LEXERS ${SRC_SCINTILLUA_LEXERS_DIR}/*.lua)
|
||||
file(GLOB LUA_PLUGINS ${CONF_DIR}/plugins/*.lua ${CONF_DIR}/plugins/*.txt)
|
||||
|
||||
# Build resources.
|
||||
@ -59,7 +59,11 @@ endif()
|
||||
|
||||
target_compile_definitions(
|
||||
app
|
||||
PUBLIC GITTYUP_NAME="${GITTYUP_NAME}" GITTYUP_VERSION="${GITTYUP_VERSION}"
|
||||
PUBLIC GITTYUP_NAME="${GITTYUP_NAME}"
|
||||
GITTYUP_VERSION="${GITTYUP_VERSION}"
|
||||
GITTYUP_IDENTIFIER="${GITTYUP_IDENTIFIER}"
|
||||
GITTYUP_DBUS_INTERFACE_NAME="${GITTYUP_IDENTIFIER}.Application"
|
||||
GITTYUP_DBUS_OBJECT_PATH="/com/github/Murmele/Gittyup/Application"
|
||||
PRIVATE QT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}"
|
||||
BUILD_DESCRIPTION="${BUILD_DESCRIPTION}")
|
||||
|
||||
@ -103,8 +107,10 @@ endif()
|
||||
target_link_libraries(gittyup app)
|
||||
|
||||
set_target_properties(
|
||||
gittyup PROPERTIES OUTPUT_NAME ${GITTYUP_NAME} RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_BINARY_DIR})
|
||||
gittyup
|
||||
PROPERTIES OUTPUT_NAME ${GITTYUP_EXECUTABLE_NAME}
|
||||
MACOSX_BUNDLE_BUNDLE_NAME ${GITTYUP_NAME}
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(app Dbghelp.lib)
|
||||
@ -118,7 +124,7 @@ elseif(APPLE)
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${GITTYUP_VERSION}
|
||||
MACOSX_BUNDLE_LONG_VERSION_STRING ${GITTYUP_VERSION}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${GITTYUP_VERSION}
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER "com.Murmele.Gittyup")
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER ${GITTYUP_IDENTIFIER})
|
||||
|
||||
# Copy config files into bundle.
|
||||
set_source_files_properties(
|
||||
@ -152,19 +158,10 @@ endif()
|
||||
|
||||
add_dependencies(gittyup indexer relauncher)
|
||||
|
||||
if(FLATPAK)
|
||||
# Install application.
|
||||
install(
|
||||
TARGETS gittyup
|
||||
DESTINATION ./bin # otherwise the executable will not be found by flatpak
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
else()
|
||||
# Install application.
|
||||
install(
|
||||
TARGETS gittyup
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endif()
|
||||
install(
|
||||
TARGETS gittyup
|
||||
DESTINATION $<IF:$<PLATFORM_ID:Darwin>,.,${CMAKE_INSTALL_BINDIR}>
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
|
||||
if(APPLE)
|
||||
get_target_property(QT_LIBRARY Qt5::Core LOCATION)
|
||||
@ -172,7 +169,7 @@ if(APPLE)
|
||||
get_filename_component(RPATH ${QT_FRAMEWORK} DIRECTORY)
|
||||
|
||||
# Fixup relauncher RPATH.
|
||||
set(RELAUNCHER ${GITTYUP_NAME}.app/Contents/MacOS/relauncher)
|
||||
set(RELAUNCHER ${CONTENTS_DIR}/MacOS/relauncher)
|
||||
install(
|
||||
CODE "execute_process(COMMAND
|
||||
${CMAKE_INSTALL_NAME_TOOL} -delete_rpath \"${RPATH}\"
|
||||
@ -189,7 +186,7 @@ execute_process(COMMAND
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
|
||||
# Fixup indexer RPATH.
|
||||
set(INDEXER ${GITTYUP_NAME}.app/Contents/MacOS/indexer)
|
||||
set(INDEXER ${CONTENTS_DIR}/MacOS/indexer)
|
||||
install(
|
||||
CODE "execute_process(COMMAND
|
||||
${CMAKE_INSTALL_NAME_TOOL} -delete_rpath \"${RPATH}\"
|
||||
@ -207,13 +204,16 @@ execute_process(COMMAND
|
||||
else()
|
||||
# Windows and UNIX must be ./ otherwise it is interpreted as absolute path
|
||||
if(UNIX)
|
||||
set(RESOURCES_INSTALL_DIR
|
||||
"${CMAKE_INSTALL_DATADIR}/gittyup/Resources"
|
||||
CACHE STRING "The path for installing resource files")
|
||||
else()
|
||||
set(RESOURCES_INSTALL_DIR
|
||||
"Resources"
|
||||
CACHE STRING "The path for installing resource files")
|
||||
install(
|
||||
FILES ${CMAKE_SOURCE_DIR}/rsrc/linux/com.github.Murmele.Gittyup.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
|
||||
RENAME ${GITTYUP_EXECUTABLE_NAME}.desktop)
|
||||
if(${GENERATE_APPDATA})
|
||||
install(
|
||||
FILES ${APPDATA}
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo
|
||||
RENAME ${GITTYUP_EXECUTABLE_NAME}.appdata.xml)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Install config files.
|
||||
@ -224,13 +224,13 @@ else()
|
||||
install(
|
||||
FILES ${CHANGELOG_HTML} ${ACKNOWLEDGMENTS_HTML} ${PRIVACY_HTML}
|
||||
${PLUGIN_HTML}
|
||||
DESTINATION ${RESOURCES_INSTALL_DIR}
|
||||
DESTINATION ${RESOURCES_DIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endif()
|
||||
|
||||
install(
|
||||
FILES ${EMOJI} ${MERGETOOLS}
|
||||
DESTINATION ${RESOURCES_INSTALL_DIR}
|
||||
DESTINATION ${RESOURCES_DIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${EMOJI}
|
||||
@ -241,7 +241,7 @@ else()
|
||||
foreach(CONFIG_FILE ${CONFIG_FILES})
|
||||
install(
|
||||
FILES ${CONFIG_FILE}
|
||||
DESTINATION ${RESOURCES_INSTALL_DIR}
|
||||
DESTINATION ${RESOURCES_DIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
|
||||
file(RELATIVE_PATH CONFIG_FILE_DEST ${CONF_DIR} ${CONFIG_FILE})
|
||||
@ -252,7 +252,7 @@ else()
|
||||
|
||||
install(
|
||||
FILES ${DICTIONARIES}
|
||||
DESTINATION ${RESOURCES_INSTALL_DIR}/dictionaries
|
||||
DESTINATION ${RESOURCES_DIR}/dictionaries
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
|
||||
foreach(DICTIONARY ${DICTIONARIES})
|
||||
@ -263,7 +263,7 @@ else()
|
||||
|
||||
install(
|
||||
FILES ${THEMES}
|
||||
DESTINATION ${RESOURCES_INSTALL_DIR}/themes
|
||||
DESTINATION ${RESOURCES_DIR}/themes
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
|
||||
foreach(THEME ${THEMES})
|
||||
@ -274,7 +274,7 @@ else()
|
||||
|
||||
install(
|
||||
FILES ${LUA_PLUGINS}
|
||||
DESTINATION ${RESOURCES_INSTALL_DIR}/plugins
|
||||
DESTINATION ${RESOURCES_DIR}/plugins
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
|
||||
foreach(LUA_PLUGIN ${LUA_PLUGINS})
|
||||
@ -286,7 +286,7 @@ else()
|
||||
foreach(SCINTILLUA_LEXER ${SCINTILLUA_LEXERS})
|
||||
install(
|
||||
FILES ${SCINTILLUA_LEXER}
|
||||
DESTINATION ${RESOURCES_INSTALL_DIR}/lexers
|
||||
DESTINATION ${RESOURCES_DIR}/lexers
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
|
||||
get_filename_component(SCINTILLUA_LEXER_DEST ${SCINTILLUA_LEXER} NAME)
|
||||
|
@ -3,16 +3,13 @@ add_library(conf ConfFile.cpp Settings.cpp Setting.cpp RecentRepositories.cpp
|
||||
|
||||
target_link_libraries(conf lua Qt5::Core util)
|
||||
|
||||
# SRC_ definitions point to the source directly
|
||||
target_compile_definitions(
|
||||
conf PRIVATE SCINTILLUA_LEXERS_DIR="${SCINTILLUA_LEXERS_DIR}")
|
||||
|
||||
if(UNIX)
|
||||
target_compile_definitions(
|
||||
conf
|
||||
PRIVATE CONF_DIR="${CMAKE_INSTALL_FULL_DATADIR}/gittyup/Resources"
|
||||
L10N_DIR="${CMAKE_INSTALL_FULL_DATADIR}/gittyup/Resources/l10n")
|
||||
else()
|
||||
|
||||
target_compile_definitions(conf PRIVATE CONF_DIR="" L10N_DIR="")
|
||||
endif()
|
||||
conf
|
||||
PRIVATE CONF_DIR="${RESOURCES_DIR}"
|
||||
SRC_CONF_DIR="${CMAKE_SOURCE_DIR}/conf"
|
||||
L10N_DIR="${L10N_INSTALL_DIR}"
|
||||
SRC_L10N_DIR="${CMAKE_SOURCE_DIR}/l10n"
|
||||
SCINTILLUA_LEXERS_DIR="${SCINTILLUA_LEXERS_DIR}"
|
||||
SRC_SCINTILLUA_LEXERS_DIR="${SRC_SCINTILLUA_LEXERS_DIR}")
|
||||
set_target_properties(conf PROPERTIES AUTOMOC ON)
|
||||
|
@ -45,18 +45,6 @@ QVariant lookup(const QVariantMap &root, const QString &key) {
|
||||
}
|
||||
|
||||
QString promptKey(Prompt::Kind kind) { return Prompt::key(kind); }
|
||||
|
||||
QDir rootDir() {
|
||||
QDir dir(QCoreApplication::applicationDirPath());
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
dir.cdUp(); // Contents
|
||||
#endif
|
||||
qDebug() << "Root dir: " << dir;
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Settings::Settings(QObject *parent) : QObject(parent) {
|
||||
@ -208,6 +196,13 @@ void Settings::setLastPath(const QString &lastPath) {
|
||||
setValue(kLastPathKey, lastPath);
|
||||
}
|
||||
|
||||
QDir Settings::rootDir() {
|
||||
QDir dir(QCoreApplication::applicationDirPath());
|
||||
dir.cdUp();
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
||||
QDir Settings::appDir() {
|
||||
QDir dir(QCoreApplication::applicationDirPath());
|
||||
|
||||
@ -223,48 +218,62 @@ QDir Settings::appDir() {
|
||||
QDir Settings::docDir() { return confDir(); }
|
||||
|
||||
QDir Settings::confDir() {
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
QDir dir(SRC_CONF_DIR);
|
||||
#else
|
||||
QDir dir = rootDir();
|
||||
if (!dir.cd("Resources"))
|
||||
dir = QDir(CONF_DIR);
|
||||
qDebug() << "Conf dir: " << dir;
|
||||
if (!dir.cd("Resources")) {
|
||||
if (!dir.cd(CONF_DIR))
|
||||
dir = SRC_CONF_DIR;
|
||||
}
|
||||
#endif
|
||||
return dir;
|
||||
}
|
||||
|
||||
QDir Settings::l10nDir() {
|
||||
#if !defined(NDEBUG)
|
||||
QDir dir = QDir(SRC_L10N_DIR);
|
||||
#else
|
||||
QDir dir = confDir();
|
||||
if (!dir.cd("l10n"))
|
||||
dir = QDir(L10N_DIR);
|
||||
|
||||
qDebug() << "l10n dir: " << dir;
|
||||
if (!dir.cd("l10n")) {
|
||||
dir = rootDir();
|
||||
if (!dir.cd(L10N_DIR))
|
||||
dir = SRC_L10N_DIR;
|
||||
}
|
||||
#endif
|
||||
return dir;
|
||||
}
|
||||
|
||||
QDir Settings::dictionariesDir() {
|
||||
QDir dir = confDir();
|
||||
dir.cd("dictionaries");
|
||||
qDebug() << "Dictionaries dir: " << dir;
|
||||
return dir;
|
||||
}
|
||||
|
||||
QDir Settings::lexerDir() {
|
||||
#if !defined(NDEBUG)
|
||||
QDir dir(SRC_SCINTILLUA_LEXERS_DIR);
|
||||
#else
|
||||
QDir dir = confDir();
|
||||
if (!dir.cd("lexers"))
|
||||
dir = QDir(SCINTILLUA_LEXERS_DIR);
|
||||
qDebug() << "Lexers dir: " << dir;
|
||||
if (!dir.cd("lexers")) {
|
||||
dir = rootDir();
|
||||
if (!dir.cd(SCINTILLUA_LEXERS_DIR))
|
||||
dir = SRC_SCINTILLUA_LEXERS_DIR;
|
||||
}
|
||||
#endif
|
||||
return dir;
|
||||
}
|
||||
|
||||
QDir Settings::themesDir() {
|
||||
QDir dir = confDir();
|
||||
dir.cd("themes");
|
||||
qDebug() << "Theme dir: " << dir;
|
||||
return dir;
|
||||
}
|
||||
|
||||
QDir Settings::pluginsDir() {
|
||||
QDir dir = confDir();
|
||||
dir.cd("plugins");
|
||||
qDebug() << "Plugins dir: " << dir;
|
||||
return dir;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
void setLastPath(const QString &lastPath);
|
||||
|
||||
// settings directories
|
||||
static QDir rootDir();
|
||||
static QDir appDir();
|
||||
static QDir docDir();
|
||||
static QDir confDir();
|
||||
|
@ -35,16 +35,8 @@ else()
|
||||
set_target_properties(indexer PROPERTIES INSTALL_RPATH "$ORIGIN")
|
||||
endif()
|
||||
|
||||
if(FLATPAK)
|
||||
# Install application.
|
||||
install(
|
||||
TARGETS indexer
|
||||
DESTINATION ./bin # otherwise the executable will not be found by flatpak
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
else()
|
||||
install(
|
||||
TARGETS indexer
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endif()
|
||||
install(
|
||||
TARGETS indexer
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endif()
|
||||
|
@ -32,16 +32,8 @@ if(APPLE)
|
||||
elseif(UNIX)
|
||||
set_target_properties(relauncher PROPERTIES INSTALL_RPATH "$ORIGIN")
|
||||
|
||||
if(FLATPAK)
|
||||
# Install application.
|
||||
install(
|
||||
TARGETS relauncher
|
||||
DESTINATION ./bin # otherwise the executable will not be found by flatpak
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
else()
|
||||
install(
|
||||
TARGETS relauncher
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endif()
|
||||
install(
|
||||
TARGETS relauncher
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT ${GITTYUP_NAME})
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user