aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/platforms/unix.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/platforms/unix.cmake b/cmake/platforms/unix.cmake
index 1bed675..b858be8 100644
--- a/cmake/platforms/unix.cmake
+++ b/cmake/platforms/unix.cmake
@@ -51,9 +51,21 @@ endif()
function(get_platform_puzzle_extra_source_files OUTVAR NAME)
if(build_icons AND EXISTS ${CMAKE_SOURCE_DIR}/icons/${NAME}.sav)
+ # If we have the equipment to rebuild the puzzles' icon images
+ # from scratch, do so. Then changes in the puzzle display code
+ # will cause the icon to auto-update.
build_icon(${NAME})
set(c_icon_file ${CMAKE_BINARY_DIR}/icons/${NAME}-icon.c)
+ elseif(EXISTS ${CMAKE_SOURCE_DIR}/icons/${NAME}-icon.c)
+ # Failing that, use a pre-built icon file in the 'icons'
+ # subdirectory, if there is one. (They don't exist in git, but the
+ # distribution tarball will have pre-built them and put them in
+ # there, so that users building from that can still have icons
+ # even if they don't have the wherewithal to rebuild them.)
+ set(c_icon_file ${CMAKE_SOURCE_DIR}/icons/${NAME}-icon.c)
else()
+ # Failing even that, include no-icon.c to satisfy the link-time
+ # dependencies. The puzzles will build without nice icons.
set(c_icon_file ${CMAKE_SOURCE_DIR}/no-icon.c)
endif()