/[ascend]/trunk/scons/graphviz.py
ViewVC logotype

Diff of /trunk/scons/graphviz.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1853 by jpye, Thu Sep 11 06:13:47 2008 UTC revision 1854 by jpye, Thu Sep 11 07:26:35 2008 UTC
# Line 1  Line 1 
1  import os, platform, subprocess  import os, os.path, platform, subprocess
2  from SCons.Script import *  from SCons.Script import *
3    
4    munge = lambda s: s
5    
6    try:
7        # if we have access to GetShortPathName, we'll use it...
8        import win32api
9        def munge1(s):
10            s1 = s
11            try:
12                # we can only munge the path if it actually exists
13                s1 = win32api.GetShortPathName(s)
14            except:
15                # if it doesn't exist, we just return the un-munged path
16                pass
17            return s1
18        munge = munge1
19    except:
20        pass
21    
22  def generate(env):  def generate(env):
23      """      """
24      Detect Graphviz settings and add them to the environment.      Detect Graphviz settings and add them to the environment.
# Line 9  def generate(env): Line 27  def generate(env):
27          if platform.system()=="Windows":          if platform.system()=="Windows":
28              import _winreg              import _winreg
29              x=_winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE)              x=_winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE)
30              y= _winreg.OpenKey(x,r"SOFTWARE\graphviz")              y= _winreg.OpenKey(x,r"SOFTWARE\ATT\GraphViz")
31              LIB,t = _winreg.QueryValueEx(y,"INSTALL_LIB")              PATH,t = _winreg.QueryValueEx(y,"InstallPath")
32              BIN,t = _winreg.QueryValueEx(y,"INSTALL_BIN")              LIB = os.path.join(PATH,"lib")
33              INCLUDE,t = _winreg.QueryValueEx(y,"INSTALL_INCLUDE")              BIN = os.path.join(PATH,"bin")
34                INCLUDE = os.path.join(PATH,"include")
35    
36              env['GRAPHVIZ_CPPPATH'] = [INCLUDE]              env['GRAPHVIZ_CPPPATH'] = [munge(INCLUDE)]
37              env['GRAPHVIZ_LIBPATH'] = [LIB]              env['GRAPHVIZ_LIBPATH'] = [munge(BIN)]
38              env['GRAPHVIZ_LIBS'] = ['graph']              env['GRAPHVIZ_LIBS'] = ['gvc','graph']
39              env['HAVE_GRAPHVIZ'] = True              env['HAVE_GRAPHVIZ'] = True
40                                                                            
41          else:          else:

Legend:
Removed from v.1853  
changed lines
  Added in v.1854

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22