Add one hard-coded fallback search paths for icon themes

The `CMAKE_INSTALL_DATAROOTDIR` variable might be overridden by the project
to point to some custom location (e.g. `share/games` instead of `share`)
but this doesn't mean we will be able to find icons there.

Since icons are almost always under `/usr/share/icons` it makes sense to
add that location as one last hard-coded fallback to avoid having to
specify `BUILTIN_ICON_THEMES_SEARCH_PATH` in that common case.
This commit is contained in:
Martchus 2023-09-06 17:32:53 +02:00
parent 490345b2ca
commit 56865f3a89
1 changed files with 3 additions and 0 deletions

View File

@ -521,6 +521,9 @@ if (REQUIRED_ICONS)
list(APPEND ICON_SEARCH_PATHS "${CMAKE_INSTALL_FULL_DATAROOTDIR}/icons")
list(APPEND ICON_SEARCH_PATHS "/usr/${CMAKE_INSTALL_DATAROOTDIR}/icons") # find icons from regular prefix when
# cross- compiling
list(APPEND ICON_SEARCH_PATHS "/usr/share/icons") # the project might change CMAKE__DATAROOTDIR
# to something custom so let's add one hardcoded fallback
list(REMOVE_DUPLICATES ICON_SEARCH_PATHS)
set(BUILTIN_ICONS_DIR "${CMAKE_CURRENT_BINARY_DIR}/icons")
set(DEFAULT_THEME_INDEX_FILE "${BUILTIN_ICONS_DIR}/default/index.theme")