CMakeLists.txt: think of older versions

At minimum it documents the novelty of the command argument.
This commit is contained in:
Přemysl Eric Janouch 2021-10-27 19:54:02 +02:00
parent f7528a05a3
commit 9aa26e2807
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 6 additions and 2 deletions

View File

@ -187,13 +187,17 @@ if (NOT WIN32)
endif (NOT WIN32) endif (NOT WIN32)
# The same for the alternative GTK+ UI # The same for the alternative GTK+ UI
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.18.0)
set (find_program_REQUIRE REQUIRED)
endif ()
function (icon_to_png svg size output_dir output) function (icon_to_png svg size output_dir output)
set (_dimensions ${size}x${size}) set (_dimensions ${size}x${size})
set (_png_path ${output_dir}/hicolor/${_dimensions}/apps) set (_png_path ${output_dir}/hicolor/${_dimensions}/apps)
set (_png ${_png_path}/sdgui.png) set (_png ${_png_path}/sdgui.png)
set (${output} ${_png} PARENT_SCOPE) set (${output} ${_png} PARENT_SCOPE)
find_program (rsvg_convert_EXECUTABLE rsvg-convert REQUIRED) find_program (rsvg_convert_EXECUTABLE rsvg-convert ${find_program_REQUIRE})
add_custom_command (OUTPUT ${_png} add_custom_command (OUTPUT ${_png}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_png_path} COMMAND ${CMAKE_COMMAND} -E make_directory ${_png_path}
COMMAND ${rsvg_convert_EXECUTABLE} --output=${_png} COMMAND ${rsvg_convert_EXECUTABLE} --output=${_png}
@ -203,7 +207,7 @@ function (icon_to_png svg size output_dir output)
endfunction () endfunction ()
function (icon_for_win32 pngs ico) function (icon_for_win32 pngs ico)
find_program (icotool_EXECUTABLE icotool REQUIRED) find_program (icotool_EXECUTABLE icotool ${find_program_REQUIRE})
add_custom_command (OUTPUT ${ico} add_custom_command (OUTPUT ${ico}
COMMAND ${icotool_EXECUTABLE} -c -o ${ico} ${pngs} COMMAND ${icotool_EXECUTABLE} -c -o ${ico} ${pngs}
DEPENDS ${pngs} DEPENDS ${pngs}