aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <6yearold@gmail.com>2016-01-10 22:32:37 +0300
committerGleb Popov <6yearold@gmail.com>2016-01-31 17:55:28 +0300
commitdde4ba04e57502f13955002d3ea3ae702c3e8c74 (patch)
treebab84c081e6b2307275a27fdd8322a262a916a8e
parent123d0d14017a25fb387efd8fe3c2c1323f9c3815 (diff)
downloadextra-cmake-modules-dde4ba04e57502f13955002d3ea3ae702c3e8c74.tar.gz
extra-cmake-modules-dde4ba04e57502f13955002d3ea3ae702c3e8c74.tar.bz2
ECMAddAppIcon: Use absolute path when operating on icons.
REVIEW: 126711
-rw-r--r--modules/ECMAddAppIcon.cmake14
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/ECMAddAppIcon.cmake b/modules/ECMAddAppIcon.cmake
index 5233a5f1..ca643142 100644
--- a/modules/ECMAddAppIcon.cmake
+++ b/modules/ECMAddAppIcon.cmake
@@ -83,21 +83,23 @@ function(ecm_add_app_icon appsources)
endforeach()
foreach(icon ${ARG_ICONS})
- if (NOT EXISTS "${icon}")
- message(AUTHOR_WARNING "${icon} does not exist, ignoring")
+ get_filename_component(icon_full ${icon} ABSOLUTE)
+ if (NOT EXISTS "${icon_full}")
+ message(AUTHOR_WARNING "${icon_full} does not exist, ignoring")
else()
+ get_filename_component(icon_name ${icon} NAME)
string(REGEX MATCH "([0-9]+)\\-[^/]+\\.([a-z]+)$"
- _dummy "${icon}")
+ _dummy "${icon_name}")
set(size "${CMAKE_MATCH_1}")
set(ext "${CMAKE_MATCH_2}")
if (NOT size)
- message(AUTHOR_WARNING "${icon} is not named correctly for ecm_add_app_icon - ignoring")
+ message(AUTHOR_WARNING "${icon_full} is not named correctly for ecm_add_app_icon - ignoring")
elseif (NOT ext STREQUAL "png")
- message(AUTHOR_WARNING "${icon} is not a png file - ignoring")
+ message(AUTHOR_WARNING "${icon_full} is not a png file - ignoring")
else()
list(FIND known_sizes "${size}" offset)
if (offset GREATER -1)
- list(APPEND icons_at_${size}px "${icon}")
+ list(APPEND icons_at_${size}px "${icon_full}")
endif()
endif()
endif()