]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | # Copyright John Maddock 2008. Use, modification, and distribution are |
2 | # subject to the Boost Software License, Version 1.0. (See accompanying | |
3 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
4 | ||
5 | import os ; | |
6 | import common ; | |
7 | import modules ; | |
8 | import regex ; | |
9 | ||
10 | inkscape_global = [ modules.peek : INKSCAPE ] ; | |
11 | ||
12 | if $(inkscape_global) | |
13 | { | |
14 | inkscape = $(inkscape_global) ; | |
15 | ||
16 | ECHO "Using the INKSCAPE environment variable to set inkscape to: " $(inkscape) ; | |
17 | } | |
18 | else if [ os.name ] = NT | |
19 | { | |
20 | ||
21 | inkscape_reg = [ W32_GETREG "HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\svgfile\\shell\\Inkscape\\command" ] ; | |
22 | inkscape_parts = [ regex.split $(inkscape_reg) "\"%1" ] ; | |
23 | inkscape = $(inkscape_parts[1]) ; | |
24 | ||
25 | ECHO "Using the Windows registry to set the Inkscape path to: " $(inkscape) ; | |
26 | ECHO "If that's not correct, try setting the INKSCAPE environment " ; | |
27 | ECHO "variable to the correct path and executable file name." ; | |
28 | } | |
29 | else | |
30 | { | |
31 | inkscape = "inkscape" ; | |
32 | ECHO "No inkscape path specified, defaulting to \"inkscape\"." ; | |
33 | ECHO "If that's not correct, try setting the INKSCAPE environment " ; | |
34 | ECHO "variable to the correct path and executable file name." ; | |
35 | } | |
36 | ||
37 | #make inkscape.check : : @inkscape-rule ; | |
38 | actions inkscape-rule | |
39 | { | |
40 | $(inkscape) --version > inkscape.version | |
41 | } | |
42 | ||
43 | ||
44 | actions svg2png | |
45 | { | |
46 | $(inkscape) -d 120 -e $(<) $(>) | |
47 | } | |
48 | for local source in [ glob *.svg ] | |
49 | { | |
50 | path-constant p : $(source:B).png ; | |
51 | make $(p) : $(source) : @svg2png ; | |
52 | } | |
53 |