From 03a876c1e9f2caeff34812e40f1174a89b9b96e1 Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 28 Nov 2024 21:04:43 +0100 Subject: Handle convert to magick transition correctly ImageMagick version 7 deprecated the `convert` command. Using it will trigger warnings on distributions with a recent version of it like e.g. Arch Linux. On other distributions (e.g. Debian) the new `magick` command is not available since ImageMagick version 6 is currently used. CMake can handle this by choosing `magick` if present and `convert` if not. This is done by this commit. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 341e7b4..1a72749 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,8 @@ set(formats ico ) +find_program(imagemagick magick convert) + foreach(icon ${icons}) foreach(format ${formats}) set(source "${CMAKE_CURRENT_SOURCE_DIR}/icons/${icon}.svg") @@ -23,7 +25,7 @@ foreach(icon ${icons}) OUTPUT ${sink} COMMAND - convert + ${imagemagick} ${intermediate} ${sink} DEPENDS -- cgit v1.2.3-70-g09d2