Changeset 19087

Show
Ignore:
Timestamp:
07/22/06 08:22:17 (2 years ago)
Author:
allenb
Message:

- Add setting of CPPDOM_INCLUDES variable
- Added method that searches for potential cppdom include directories in existing directory settings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PyJuggler/trunk/buildwin32.py

    r19057 r19087  
    1212import time 
    1313import traceback 
     14pj = os.path.join 
    1415 
    1516python_ver_re = re.compile(r'(\d+)\.(\d+)') 
     
    4041   options = { 
    4142      # Default values for required settings. 
    42       'VJ_BASE_DIR'    : os.getenv('VJ_BASE_DIR', ''), 
    43       'VJ_DEPS_DIR'    : os.getenv('VJ_DEPS_DIR', ''), 
    44       'BOOST_VERSION'  : os.getenv('BOOST_VERSION', '1_32'), 
    45       'BOOST_TOOL'     : os.getenv('BOOST_TOOL', 'vc71'), 
    46       'PYTHON_ROOT'    : os.getenv('PYTHON_ROOT', ''), 
    47       'PYTHON_VERSION' : os.getenv('PYTHON_VERSION', sys.version[:3]), 
    48       'prefix'         : r'C:\PyJuggler', 
     43      'VJ_BASE_DIR'     : os.getenv('VJ_BASE_DIR', ''), 
     44      'VJ_DEPS_DIR'     : os.getenv('VJ_DEPS_DIR', ''), 
     45      'CPPDOM_INCLUDES' : os.getenv('CPPDOM_INCLUDES',''),  
     46      'BOOST_VERSION'   : os.getenv('BOOST_VERSION', '1_32'), 
     47      'BOOST_TOOL'      : os.getenv('BOOST_TOOL', 'vc71'), 
     48      'PYTHON_ROOT'     : os.getenv('PYTHON_ROOT', ''), 
     49      'PYTHON_VERSION'  : os.getenv('PYTHON_VERSION', sys.version[:3]), 
     50      'prefix'          : r'C:\PyJuggler', 
    4951 
    5052      # Default values for optional settings. 
    5153      'OSGHOME'        : os.getenv('OSGHOME', '') 
    5254   } 
    53  
     55       
    5456   # If there are cached options, read them in. 
    5557   cache_file = os.path.join(pyj_dir, 'options.cache') 
     
    6264   processInput(options, 'VJ_DEPS_DIR', 
    6365                'VR Juggler dependency installation directory') 
     66    
     67   if "" == options["CPPDOM_INCLUDES"]: 
     68      roots = [pj(options[v],'include') for v in ['VJ_BASE_DIR','VJ_DEPS_DIR']] 
     69      options["CPPDOM_INCLUDES"] = findCppdomIncludeDir(roots) 
     70 
     71   processInput(options, 'CPPDOM_INCLUDES',  
     72                'Directory containing the CppDOM header tree')                 
    6473   processInput(options, 'BOOST_VERSION', 'Boost C++ version') 
    6574   processInput(options, 'BOOST_TOOL', 
     
    8897   return options 
    8998 
     99def findCppdomIncludeDir(potentialIncRoots): 
     100   """ Attempt to search for cppdom include directory.  If found return it. 
     101       potentialIncRoots should be an 'include' directory to search in. 
     102   """ 
     103   found_dir = "" 
     104   potential_dirs = [] 
     105   for root in potentialIncRoots: 
     106      if os.path.isdir(root): 
     107         potential_dirs += [pj(root,d) for d in os.listdir(root) if d.count("cppdom")] 
     108    
     109   # Sort them and reverse the order to get a list based on version. 
     110   potential_dirs.sort() 
     111   potential_dirs.reverse() 
     112 
     113   for d in potential_dirs: 
     114      if os.path.isfile(pj(d,'cppdom','version.h')): 
     115         found_dir = d 
     116         break          
     117 
     118   return found_dir 
     119             
    90120def doInstall(prefix): 
    91121   makeTree(prefix)