chiark / gitweb /
Make the icons build step optional.
authorSimon Tatham <anakin@pobox.com>
Wed, 31 Mar 2021 17:44:44 +0000 (18:44 +0100)
committerSimon Tatham <anakin@pobox.com>
Wed, 31 Mar 2021 17:44:44 +0000 (18:44 +0100)
This way, ImageMagick is no longer a hard build dependency. For
developers or users, building puzzles without nice icons is preferable
to not building them at all.

(Also, thanks to Michael Quevillon for pointing out very promptly that
my use of 'REQUIRED' in the find_program command was implicitly
depending on a version of CMake in advance of my minimum_required
specification. This change fixes that too, in passing.)

icons/icons.cmake

index 5bd92855ea006efb22e65cf912fcc7e97acc8455..873c3c71b24e36f63cd0dc61c5d81fef0a2c21c2 100644 (file)
@@ -4,8 +4,13 @@ if(NOT build_icons)
   return()
 endif()
 
-find_program(CONVERT convert REQUIRED)
-find_program(IDENTIFY identify REQUIRED)
+find_program(CONVERT convert)
+find_program(IDENTIFY identify)
+if(NOT CONVERT OR NOT IDENTIFY)
+  message(WARNING "Puzzle icons cannot be rebuilt (did not find ImageMagick)")
+  set(build_icons FALSE)
+  return()
+endif()
 
 # For puzzles which have animated moves, it's nice to show the sample
 # image part way through the animation of a move. This setting will