• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5import os ;
6import common ;
7import modules ;
8import regex ;
9
10inkscape_global = [ modules.peek : INKSCAPE ] ;
11
12if $(inkscape_global)
13{
14   inkscape = $(inkscape_global) ;
15
16   ECHO "Using the INKSCAPE environment variable to set inkscape to: " $(inkscape) ;
17}
18else 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}
29else
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 ;
38actions inkscape-rule
39{
40    $(inkscape) --version > inkscape.version
41}
42
43
44actions svg2png
45{
46    $(inkscape) -d 120 -e $(<) $(>)
47}
48for local source in [ glob *.svg ]
49{
50   path-constant p : $(source:B).png ;
51   make $(p) : $(source) : @svg2png ;
52}
53
54