aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@kde.org>2015-03-14 12:44:49 +0000
committerAlex Merry <alex.merry@kde.org>2015-03-15 18:39:48 +0000
commit19353c9857d1e26c6508c2fc7dd530e6ee0ef316 (patch)
treea7ad4ba89dc39cd5b38a7326b200f2456d5b69d0 /modules
parent03d5bbda45a9cc117fd03e272113ddd9439aebf5 (diff)
downloadextra-cmake-modules-19353c9857d1e26c6508c2fc7dd530e6ee0ef316.tar.gz
extra-cmake-modules-19353c9857d1e26c6508c2fc7dd530e6ee0ef316.tar.bz2
Warn about icon filenames with leading characters.
Through a quirk of implementation, old-style icon filenames are accepted by the new-style ecm_install_icons function. It's too late to change it now, as that would break existing projects, but we can warn about it. REVIEW: 122941
Diffstat (limited to 'modules')
-rw-r--r--modules/ECMInstallIcons.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/ECMInstallIcons.cmake b/modules/ECMInstallIcons.cmake
index 34d5a485..79dc5150 100644
--- a/modules/ECMInstallIcons.cmake
+++ b/modules/ECMInstallIcons.cmake
@@ -223,8 +223,9 @@ function(ecm_install_icons)
endif()
foreach(icon ${ARG_ICONS})
+ get_filename_component(filename "${icon}" NAME)
string(REGEX MATCH "([0-9sc]+)\\-([a-z]+)\\-([^/]+)\\.([a-z]+)$"
- _dummy "${icon}")
+ complete_match "${filename}")
set(size "${CMAKE_MATCH_1}")
set(group "${CMAKE_MATCH_2}")
set(name "${CMAKE_MATCH_3}")
@@ -234,6 +235,12 @@ function(ecm_install_icons)
elseif(NOT size STREQUAL "sc" AND NOT size GREATER 0)
message(WARNING "${icon} size (${size}) is invalid - ignoring")
else()
+ if (NOT complete_match STREQUAL filename)
+ # We can't stop accepting filenames with leading characters,
+ # because that would break existing projects, so just warn
+ # about them instead.
+ message(AUTHOR_WARNING "\"${icon}\" has characters before the size; it should be renamed to \"${size}-${group}-${name}.${ext}\"")
+ endif()
if(NOT _ECM_ICON_GROUP_${group})
message(WARNING "${icon} group (${group}) is not recognized")
endif()