blob: 16ee68c4a336bb5fe0802c727456fff7837ee1e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
set(icons
example
)
set(formats
pdf
svg
png
jpg
)
foreach(icon ${icons})
foreach(format ${formats})
if(format STREQUAL jpg)
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/${icon}.${format}
COMMAND
magick
${CMAKE_CURRENT_BINARY_DIR}/${icon}.png
${CMAKE_CURRENT_BINARY_DIR}/${icon}.${format}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/${icon}.png
)
else()
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/${icon}.${format}
COMMAND
SELF_CALL=xxx # https://gitlab.com/inkscape/inkscape/-/issues/4716
inkscape
--export-type=${format}
--export-filename=${CMAKE_CURRENT_BINARY_DIR}/${icon}.${format}
${CMAKE_CURRENT_SOURCE_DIR}/${icon}.svg
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/${icon}.svg
)
endif()
add_custom_target(
"icon-${icon}-${format}"
ALL
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/${icon}.${format}
)
endforeach()
endforeach()
|