summaryrefslogtreecommitdiff
path: root/xW
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-02-10 05:50:12 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-03-04 16:15:22 +0100
commitf8ea1634c4ea6f7dd6f88bff17d05223eba85f8e (patch)
treebdf4e94c7dc88e2dde211c31c978dc30c4296e96 /xW
parentef257cd5757fd6ae13d7639d6ed17dd779f173e3 (diff)
downloadxK-f8ea1634c4ea6f7dd6f88bff17d05223eba85f8e.tar.gz
xK-f8ea1634c4ea6f7dd6f88bff17d05223eba85f8e.tar.xz
xK-f8ea1634c4ea6f7dd6f88bff17d05223eba85f8e.zip
Bump liberty
Diffstat (limited to 'xW')
-rw-r--r--xW/CMakeLists.txt39
1 files changed, 5 insertions, 34 deletions
diff --git a/xW/CMakeLists.txt b/xW/CMakeLists.txt
index dc3e5c9..c6a715a 100644
--- a/xW/CMakeLists.txt
+++ b/xW/CMakeLists.txt
@@ -24,42 +24,11 @@ set (project_config ${PROJECT_BINARY_DIR}/config.h)
configure_file (${PROJECT_SOURCE_DIR}/config.h.in ${project_config})
include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
-# Icon generation utilities
-# TODO: Shove this into liberty as a CMake module, similar to AddThreads,
-# and remove the copies in the parent CMakeLists.txt as well as in tdv.
+# Produce a beep sample
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.18.0)
set (find_program_REQUIRE REQUIRED)
endif ()
-function (icon_to_png name svg size output_dir output)
- set (_dimensions ${size}x${size})
- set (_png_path ${output_dir}/hicolor/${_dimensions}/apps)
- set (_png ${_png_path}/${name}.png)
- set (${output} ${_png} PARENT_SCOPE)
-
- find_program (rsvg_convert_EXECUTABLE rsvg-convert ${find_program_REQUIRE})
- add_custom_command (OUTPUT ${_png}
- COMMAND ${CMAKE_COMMAND} -E make_directory ${_png_path}
- COMMAND ${rsvg_convert_EXECUTABLE} --output=${_png}
- --width=${size} --height=${size} ${svg}
- DEPENDS ${svg}
- COMMENT "Generating ${name} ${_dimensions} application icon" VERBATIM)
-endfunction ()
-
-function (icon_for_win32 ico pngs pngs_raw)
- set (_raws)
- foreach (png ${pngs_raw})
- list (APPEND _raws "--raw=${png}")
- endforeach ()
-
- find_program (icotool_EXECUTABLE icotool ${find_program_REQUIRE})
- add_custom_command (OUTPUT ${ico}
- COMMAND ${icotool_EXECUTABLE} -c -o ${ico} ${_raws} -- ${pngs}
- DEPENDS ${pngs} ${pngs_raw}
- COMMENT "Generating Windows program icon" VERBATIM)
-endfunction ()
-
-# Produce a beep sample
find_program (sox_EXECUTABLE sox ${find_program_REQUIRE})
add_custom_command (OUTPUT beep.wav
COMMAND ${sox_EXECUTABLE} -b 16 -Dr 44100 -n beep.wav
@@ -67,6 +36,10 @@ add_custom_command (OUTPUT beep.wav
COMMENT "Generating a beep sample" VERBATIM)
# Rasterize SVG icons
+set (root "${PROJECT_SOURCE_DIR}/..")
+set (CMAKE_MODULE_PATH ${root}/liberty/cmake)
+include (IconUtils)
+
set (icon_ico_list)
foreach (icon xW xW-highlighted)
set (icon_png_list)
@@ -87,8 +60,6 @@ set_property (SOURCE xW.rc
APPEND PROPERTY OBJECT_DEPENDS ${icon_ico_list} beep.wav)
# Build the main executable and link it
-set (root "${PROJECT_SOURCE_DIR}/..")
-
find_program (awk_EXECUTABLE awk ${find_program_REQUIRE})
add_custom_command (OUTPUT xC-proto.cpp
COMMAND ${CMAKE_COMMAND} -E env LC_ALL=C ${awk_EXECUTABLE}