diff --git a/CMakeLists.txt b/CMakeLists.txt index 47ec85d06..5164ba505 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,10 @@ include(CheckIncludeFile) include(gbversion.cmake) project(gpsbabel LANGUAGES C CXX VERSION ${GB.VERSION}) +if(UNIX AND NOT APPLE) + include(GNUInstallDirs) +endif() + set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) @@ -493,3 +497,6 @@ if(UNIX AND NOT APPLE) VERBATIM USES_TERMINAL) endif() +if(_GPSBABEL_INSTALL) + install(TARGETS gpsbabel DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 2c88b56ce..e18167b6f 100755 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -329,3 +329,17 @@ else() endif() endif() endif() +if(UNIX AND NOT APPLE) + if (((GPSBABEL_GOOGLE_MAPPREVIEW AND GPSBABEL_EMBED_MAP) OR NOT GPSBABEL_GOOGLE_MAPPREVIEW) AND GPSBABEL_EMBED_TRANSLATIONS) + set(_GPSBABEL_INSTALL ON PARENT_SCOPE) + install(TARGETS gpsbabelfe DESTINATION ${CMAKE_INSTALL_BINDIR}) + # you probably don't need to run update-desktop-database on ${CMAKE_INSTALL_DATADIR}/applications as our desktop file doesn't have MimeTypes. + install(FILES gpsbabelfe.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) + # you may need to run gtk-update-icon-cache on ${CMAKE_INSTALL_DATADIR}/icons/hicolor, possibly with -t or equivalently with --ignore-theme-index. + foreach(resolution 16 22 24 32 48 64 128 256) + install(FILES "images/appicon-${resolution}x${resolution}.png" DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/${resolution}x${resolution}/apps" RENAME "gpsbabelfe.png") + endforeach() + else() + message(WARNING "\"cmake --install\" not supported. The file gpsbabel.html is expected to be installed in the same directory as gpsbablefe. The gpsbable(fe) translations are expected to be in the translations sub-directory of the directory that gpsbabelfe is installed in. This is problematic with GNU Coding Standards. Use GPSBABLE_EMBED_MAP and GPSBABEL_EMBED_TRANSLATIONS.") + endif() +endif() diff --git a/gui/genpngs.sh b/gui/genpngs.sh new file mode 100755 index 000000000..cb2512e63 --- /dev/null +++ b/gui/genpngs.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e +commondims=(16 22 24 32 48 64 128 256) +for dim in "${commondims[@]}" +do + dims=${dim}x${dim} + mkdir -p "images/hicolor/${dims}/apps" + cp images/appicon.png "images/appicon-${dims}.png" + mogrify -resize "${dims}>" -background none -gravity center -extent "${dims}" "images/appicon-${dims}.png" +done diff --git a/gui/gpsbabel.desktop b/gui/gpsbabelfe.desktop similarity index 91% rename from gui/gpsbabel.desktop rename to gui/gpsbabelfe.desktop index fe956c2b7..91892cfae 100644 --- a/gui/gpsbabel.desktop +++ b/gui/gpsbabelfe.desktop @@ -3,7 +3,7 @@ Type=Application Name=GPSBabel Comment=Qt GUI interface for GPSBabel GenericName=GPSBabel -Icon=gpsbabel +Icon=gpsbabelfe Exec=gpsbabelfe Terminal=false Categories=Geography;Education;Utility; diff --git a/gui/images/appicon-128x128.png b/gui/images/appicon-128x128.png new file mode 100644 index 000000000..6cb58786b Binary files /dev/null and b/gui/images/appicon-128x128.png differ diff --git a/gui/images/appicon-16x16.png b/gui/images/appicon-16x16.png new file mode 100644 index 000000000..7aa55b627 Binary files /dev/null and b/gui/images/appicon-16x16.png differ diff --git a/gui/images/appicon-22x22.png b/gui/images/appicon-22x22.png new file mode 100644 index 000000000..0d834d286 Binary files /dev/null and b/gui/images/appicon-22x22.png differ diff --git a/gui/images/appicon-24x24.png b/gui/images/appicon-24x24.png new file mode 100644 index 000000000..e1df48c5b Binary files /dev/null and b/gui/images/appicon-24x24.png differ diff --git a/gui/images/appicon-256x256.png b/gui/images/appicon-256x256.png new file mode 100644 index 000000000..919277b43 Binary files /dev/null and b/gui/images/appicon-256x256.png differ diff --git a/gui/images/appicon-32x32.png b/gui/images/appicon-32x32.png new file mode 100644 index 000000000..0afb666ea Binary files /dev/null and b/gui/images/appicon-32x32.png differ diff --git a/gui/images/appicon-48x48.png b/gui/images/appicon-48x48.png new file mode 100644 index 000000000..bc6ddfe80 Binary files /dev/null and b/gui/images/appicon-48x48.png differ diff --git a/gui/images/appicon-64x64.png b/gui/images/appicon-64x64.png new file mode 100644 index 000000000..671b86300 Binary files /dev/null and b/gui/images/appicon-64x64.png differ diff --git a/snap/gui/gpsbabel.png b/snap/gui/gpsbabel.png deleted file mode 100644 index 5f37f68fa..000000000 Binary files a/snap/gui/gpsbabel.png and /dev/null differ diff --git a/snap/gui/gpsbabel.desktop b/snap/gui/gpsbabelfe.desktop similarity index 83% rename from snap/gui/gpsbabel.desktop rename to snap/gui/gpsbabelfe.desktop index 3f90c710a..1ef407895 100644 --- a/snap/gui/gpsbabel.desktop +++ b/snap/gui/gpsbabelfe.desktop @@ -3,7 +3,7 @@ Type=Application Name=GPSBabel Comment=Qt GUI interface for GPSBabel GenericName=GPSBabel -Icon=${SNAP}/meta/gui/gpsbabel.png +Icon=${SNAP}/meta/gui/gpsbabelfe.png Exec=gpsbabel.gpsbabelfe Terminal=false Categories=Geography;Education;Utility; diff --git a/snap/gui/gpsbabelfe.png b/snap/gui/gpsbabelfe.png new file mode 100644 index 000000000..01a866d45 Binary files /dev/null and b/snap/gui/gpsbabelfe.png differ