From 4166b17b00a6f300773d77c225cafef459bc7427 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Thu, 15 Jun 2023 15:44:00 +0200 Subject: Add an icon and a desktop file for the GUI --- CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++ nncmpp.desktop | 9 +++++++++ nncmpp.svg | 9 +++++++++ 3 files changed, 51 insertions(+) create mode 100644 nncmpp.desktop create mode 100644 nncmpp.svg diff --git a/CMakeLists.txt b/CMakeLists.txt index 9333b13..f5e8afd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,6 +129,12 @@ install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) install (DIRECTORY contrib DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) install (DIRECTORY info DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) +if (WITH_X11) + install (FILES ${PROJECT_NAME}.svg + DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) + install (FILES ${PROJECT_NAME}.desktop + DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) +endif () # Generate documentation from text markup find_program (ASCIIDOCTOR_EXECUTABLE asciidoctor) @@ -176,6 +182,33 @@ foreach (page ${project_MAN_PAGES}) DESTINATION "${CMAKE_INSTALL_MANDIR}/man${CMAKE_MATCH_1}") endforeach () +# Testing +option (BUILD_TESTING "Build tests" OFF) +if (BUILD_TESTING) + enable_testing () + + find_program (xmlwf_EXECUTABLE xmlwf) + find_program (xmllint_EXECUTABLE xmllint) + foreach (xml ${PROJECT_NAME}.svg) + if (xmlwf_EXECUTABLE) + add_test (test-xmlwf-${xml} ${xmlwf_EXECUTABLE} + ${PROJECT_SOURCE_DIR}/${xml}) + endif () + if (xmllint_EXECUTABLE) + add_test (test-xmllint-${xml} ${xmllint_EXECUTABLE} --noout + ${PROJECT_SOURCE_DIR}/${xml}) + endif () + endforeach () + + find_program (dfv_EXECUTABLE desktop-file-validate) + if (dfv_EXECUTABLE) + foreach (df ${PROJECT_NAME}.desktop) + add_test (test-dfv-${df} ${dfv_EXECUTABLE} + ${PROJECT_SOURCE_DIR}/${df}) + endforeach () + endif () +endif () + # CPack set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Terminal/X11 MPD client") set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch") diff --git a/nncmpp.desktop b/nncmpp.desktop new file mode 100644 index 0000000..4ba2668 --- /dev/null +++ b/nncmpp.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=nncmpp +GenericName=MPD client +Icon=nncmpp +Exec=nncmpp %U +StartupNotify=false +# Not registering a MimeType, because that depends on MPD. +Categories=AudioVideo;Audio;Player; diff --git a/nncmpp.svg b/nncmpp.svg new file mode 100644 index 0000000..8960736 --- /dev/null +++ b/nncmpp.svg @@ -0,0 +1,9 @@ + + -- cgit v1.2.3-70-g09d2