1 macro(add_cursor cursor color theme dpi)
2 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/svg/${cursor}.svg
3 DEPENDS ${MAKE_SVG} ${CMAKE_CURRENT_SOURCE_DIR}/colors.in ${SVGDIR}/${cursor}.svg
4 COMMAND ${CMAKE_COMMAND} -Dconfig=${CMAKE_CURRENT_SOURCE_DIR}/colors.in
5 -Dinput=${SVGDIR}/${cursor}.svg
6 -Doutput=${CMAKE_BINARY_DIR}/oxy-${theme}/svg/${cursor}.svg
9 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/png/${cursor}.png
10 DEPENDS ${CMAKE_BINARY_DIR}/oxy-${theme}/svg/${cursor}.svg
11 COMMAND ${INKSCAPE} --without-gui --export-dpi=${dpi}
12 --export-png=${CMAKE_BINARY_DIR}/oxy-${theme}/png/${cursor}.png
13 ${CMAKE_BINARY_DIR}/oxy-${theme}/svg/${cursor}.svg
17 macro(add_x_cursor theme cursor dpi)
19 foreach(png ${${cursor}_inputs})
20 list(APPEND inputs ${CMAKE_BINARY_DIR}/oxy-${theme}/png/${png})
22 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
23 DEPENDS ${MAKE_CONFIG} ${CONFIGDIR}/${cursor}.in
24 COMMAND ${CMAKE_COMMAND} -Dconfig=${CONFIGDIR}/${cursor}.in
25 -Doutput=${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
30 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor}
31 DEPENDS ${inputs} ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
32 COMMAND ${XCURSORGEN} -p ${CMAKE_BINARY_DIR}/oxy-${theme}/png
33 ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
34 ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor}
37 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor}
38 DEPENDS ${inputs} ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
39 COMMAND "${CMAKE_SOURCE_DIR}/wincursor.py" ${CMAKE_BINARY_DIR}/oxy-${theme}/png
40 ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in
41 ${CMAKE_BINARY_DIR}/wincursors/oxy-${theme}
42 ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor}
45 endmacro(add_x_cursor)
47 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/packages)
48 macro(add_theme color theme dpi)
49 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/png)
50 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/svg)
51 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/config)
52 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors)
54 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/wincursors/oxy-${theme})
58 string(REGEX REPLACE ".*/" "" cursor ${svg})
59 string(REGEX REPLACE "[.]svg" "" cursor ${cursor})
60 add_cursor(${cursor} ${color} ${theme} ${dpi})
62 foreach(cursor ${CURSORS})
63 add_x_cursor(${theme} ${cursor} ${dpi})
64 list(APPEND ${theme}_cursors ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor})
66 add_custom_target(theme-${theme} ALL DEPENDS ${${theme}_cursors})
67 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/index.theme
68 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/index.theme
69 COMMAND ${CMAKE_COMMAND} -E copy_if_different
70 ${CMAKE_CURRENT_SOURCE_DIR}/index.theme
71 ${CMAKE_BINARY_DIR}/oxy-${theme}/index.theme
73 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/packages/oxy-${theme}.tar.bz2
74 DEPENDS ${${theme}_cursors} ${CMAKE_BINARY_DIR}/oxy-${theme}/index.theme
75 COMMAND ${TAR} cjf ${CMAKE_BINARY_DIR}/packages/oxy-${theme}.tar.bz2
77 oxy-${theme}/index.theme
78 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
80 add_custom_target(package-${theme} DEPENDS ${CMAKE_BINARY_DIR}/packages/oxy-${theme}.tar.bz2)