diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 629abd85..890d655f 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -81,15 +81,23 @@ target_link_libraries(librepods target_include_directories(librepods PRIVATE ${PULSEAUDIO_INCLUDE_DIRS}) include(GNUInstallDirs) + +# Install the binary install(TARGETS librepods BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) + +# Install desktop entry install(FILES assets/me.kavishdevar.librepods.desktop - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications" +) + +# Install icon install(FILES assets/librepods.png - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps") + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" +) # Translation support qt_add_translations(librepods @@ -99,4 +107,16 @@ qt_add_translations(librepods # Install translation files install(FILES ${QM_FILES} - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/librepods/translations") + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/librepods/translations" +) + +# -------------------------------------------------------------- +# Update icon and desktop caches after installation +# -------------------------------------------------------------- +install(CODE " + message(STATUS \"Updating icon cache...\") + execute_process(COMMAND update-icon-caches ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor) + + message(STATUS \"Updating desktop database...\") + execute_process(COMMAND update-desktop-database ${CMAKE_INSTALL_DATAROOTDIR}/applications) +") diff --git a/linux/README.md b/linux/README.md index e405b90e..2bbc5860 100644 --- a/linux/README.md +++ b/linux/README.md @@ -24,8 +24,10 @@ A native Linux application to control your AirPods, with support for: # For Debian sudo apt-get install qt6-base-dev qt6-declarative-dev qt6-connectivity-dev qt6-multimedia-dev \ - qml6-module-qtquick-controls qml6-module-qtqml-workerscript qml6-module-qtquick-templates \ - qml6-module-qtquick-window qml6-module-qtquick-layouts + qt6-base-dev-tools qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libxkbcommon-dev \ + qml6-module-qtquick-controls qml6-module-qtqml-workerscript qml6-module-qtquick-templates \ + qml6-module-qtquick-window qml6-module-qtquick-layouts build-essential cmake ninja-build + # For Fedora sudo dnf install qt6-qtbase-devel qt6-qtconnectivity-devel \ @@ -84,6 +86,14 @@ A native Linux application to control your AirPods, with support for: ```bash ./librepods ``` +3. (Optional) Install system-wide desktop entry + icon + ```bash + sudo make install + ``` + After this, you can launch LibrePods from your desktop menu or run: + ```bash + librepods + ``` ## Troubleshooting