diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2020-11-03 18:58:47 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2020-11-04 19:21:52 +0300 |
commit | 0d1fa8177acc5b61ebd3bdc2555769226282891d (patch) | |
tree | 1b8e419ca7292824636613b5d51afe9a54a33158 | |
parent | 770ae130f35024f8564c5ae136a3c46d5cd07686 (diff) |
Support legacy naming of app icon
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | THEME.cmake | 1 | ||||
-rw-r--r-- | src/gui/CMakeLists.txt | 15 |
3 files changed, 16 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cd5075f23..f2c28f328 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,8 @@ set(DATADIR "share") endif(WIN32) set(SHAREDIR ${DATADIR}) +set(OEM_THEME_DIR "${PROJECT_SOURCE_DIR}" CACHE STRING "Define directory containing a custom theme") + # this option removes Http authentication, keychain, shibboleth etc and is intended for # external authentication mechanisms option(TOKEN_AUTH_ONLY "TOKEN_AUTH_ONLY" OFF) diff --git a/THEME.cmake b/THEME.cmake index 162ed3fb8..c0de50c6f 100644 --- a/THEME.cmake +++ b/THEME.cmake @@ -1,4 +1,3 @@ -set(OEM_THEME_DIR "" CACHE STRING "Define directory containing a custom theme") if (EXISTS "${OEM_THEME_DIR}/OEM.cmake") include("${OEM_THEME_DIR}/OEM.cmake") else() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 3736a268b..1568d1dc5 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -219,8 +219,21 @@ else() endif() # add executable icon on windows and osx - file(GLOB_RECURSE OWNCLOUD_ICONS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-icon.png") +if (NOT OWNCLOUD_ICONS) + # allow legacy file names + file(GLOB_RECURSE OWNCLOUD_ICONS_OLD "${theme_dir}/colored/${APPLICATION_ICON_NAME}-icon-*.png") + MESSAGE(STATUS "OWNCLOUD_ICONS_OLD: ${APPLICATION_ICON_NAME}: ${OWNCLOUD_ICONS_OLD}") + foreach(icon ${OWNCLOUD_ICONS_OLD}) + get_filename_component(icon_name ${icon} NAME) + string(REGEX MATCH "([0-9]+)" size ${icon_name}) + set(out_name "${CMAKE_BINARY_DIR}/${size}-app-icon.png") + configure_file(${icon} ${out_name} COPYONLY) + list(APPEND OWNCLOUD_ICONS ${out_name}) + endforeach() +endif() +MESSAGE(STATUS "OWNCLOUD_ICONS: ${APPLICATION_ICON_NAME}: ${OWNCLOUD_ICONS}") + if(APPLE) file(GLOB_RECURSE OWNCLOUD_SIDEBAR_ICONS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-icon-sidebar.png") MESSAGE(STATUS "OWNCLOUD_SIDEBAR_ICONS: ${APPLICATION_ICON_NAME}: ${OWNCLOUD_SIDEBAR_ICONS}") |