diff --git a/KF5Kirigami2Macros.cmake b/KF5Kirigami2Macros.cmake --- a/KF5Kirigami2Macros.cmake +++ b/KF5Kirigami2Macros.cmake @@ -20,19 +20,24 @@ file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/48/${icon}.svg ) #seach in other sizes as well - if (NOT EXISTS ${path}) + if (path STREQUAL "") file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/32/${icon}.svg ) - if (NOT EXISTS ${path}) + if (path STREQUAL "") file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/22/${icon}.svg ) endif() endif() - if (NOT EXISTS ${path}) + if (path STREQUAL "") file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/symbolic/${icon}.svg ) endif() - if (NOT EXISTS ${path}) + if (path STREQUAL "") return() endif() + list(LENGTH path _count_paths) + if (_count_paths GREATER 1) + message(WARNING "Found more than one version of '${icon}': ${path}") + endif() + list(GET path 0 path) get_filename_component(path "${path}" REALPATH) SET(${varName} ${path} PARENT_SCOPE)