[Python-ogre-commit] SF.net SVN: python-ogre: [449] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
|
From: <and...@us...> - 2007-10-22 03:36:54
|
Revision: 449
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=449&view=rev
Author: andy_miller
Date: 2007-10-21 20:36:58 -0700 (Sun, 21 Oct 2007)
Log Message:
-----------
Allow demos to find their library files without environment variables being set
Modified Paths:
--------------
trunk/python-ogre/demos/PythonOgreConfig.py
trunk/python-ogre/environment.py
Modified: trunk/python-ogre/demos/PythonOgreConfig.py
===================================================================
--- trunk/python-ogre/demos/PythonOgreConfig.py 2007-10-22 03:02:20 UTC (rev 448)
+++ trunk/python-ogre/demos/PythonOgreConfig.py 2007-10-22 03:36:58 UTC (rev 449)
@@ -3,7 +3,29 @@
# this is primarly used to manage Linux demos when we have binaries in non standard (safe) locations
import os,sys
-if os.name != 'nt':
+if os.name == 'nt':
libpath=""
- pythonpath = ""
-
\ No newline at end of file
+ pythonpath = ""
+else:
+ localpath = os.path.abspath('.') ## should be one of the demo directories
+ libpath = os.path.abspath(os.path.join(localpath,'../../lib'))
+ if not os.path.exists ( libpath ): #we must be running from the development environment
+ libpath = os.path.abspath(os.path.join(localpath,'../../../root/usr/lib'))
+ if not os.path.exists ( libpath ):
+ ## should die here
+ print "**Problem finding libraries"
+ libpath=localpath
+
+ ## path to the Python-Ogre modules
+ pythonpath = os.path.abspath(os.path.join(libpath, 'python2.5/site-packages') )
+ ## and insert it into the system path
+ sys.path.insert(0,pythonpath)
+
+ ## now we need to set the library path so the shared libraries can be found
+ try:
+ ldpath = os.environ['LD_LIBRARY_PATH']
+ except:
+ ldpath=""
+ newldpath = libpath + ":" + ldpath
+ os.environ['LD_LIBRARY_PATH'] = newldpath
+
Modified: trunk/python-ogre/environment.py
===================================================================
--- trunk/python-ogre/environment.py 2007-10-22 03:02:20 UTC (rev 448)
+++ trunk/python-ogre/environment.py 2007-10-22 03:36:58 UTC (rev 449)
@@ -389,7 +389,7 @@
## note the defined for _QuickGUIExport forces non dll usage
CCFLAGS = ' -DWIN32 -DNDEBUG -DWINDOWS -D_QuickGUIExport="" '
else:
- CCFLAGS = ''
+ CCFLAGS = ' -D_QuickGUIExport="" '
cflags=""
include_dirs = [ Config.PATH_Boost,
Config.PATH_INCLUDE_Ogre,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|