41
41
import os
42
42
# to know the os
43
43
import platform
44
+ import sys
44
45
45
46
# Escapes arguments and return them joined in a string
46
47
def escapeAndJoin (strList ):
@@ -849,8 +850,8 @@ def setMacOSXDefaultEnvironment():
849
850
qgis_standalone_gdal_path = u"%s/Frameworks/GDAL.framework" % qgis_app
850
851
851
852
# path to the GDAL framework when installed as external framework
852
- # TODO adjust this for gdal 1.10
853
- gdal_bin_path = u"/Library/Frameworks/GDAL.framework/Versions/%s/Programs " % str ( GdalConfig . version ())[: 3 ]
853
+ gdal_versionsplit = str ( GdalConfig . version ()). split ( '.' )
854
+ gdal_base_path = u"/Library/Frameworks/GDAL.framework/Versions/%s.%s " % ( gdal_versionsplit [ 0 ], gdal_versionsplit [ 1 ])
854
855
855
856
if os .path .exists ( qgis_standalone_gdal_path ): # qgis standalone
856
857
# GDAL executables are in the QGis bin folder
@@ -859,11 +860,18 @@ def setMacOSXDefaultEnvironment():
859
860
# GDAL pymods are in the QGis python folder
860
861
if getGdalPymodPath ().isEmpty ():
861
862
setGdalPymodPath ( qgis_python )
863
+ # GDAL help is in the framework folder
864
+ if getHelpPath ().isEmpty ():
865
+ setHelpPath ( u"%s/Resources/doc" % qgis_standalone_gdal_path )
862
866
863
- elif os .path .exists ( gdal_bin_path ):
864
- # GDAL executables are in the GDAL framework Programs folder
867
+ elif os .path .exists ( gdal_base_path ):
868
+ # all GDAL parts are in the GDAL framework folder
865
869
if getGdalBinPath ().isEmpty ():
866
- setGdalBinPath ( gdal_bin_path )
870
+ setGdalBinPath ( u"%s/Programs" % gdal_base_path )
871
+ if getGdalPymodPath ().isEmpty ():
872
+ setGdalPymodPath ( u"%s/Python/%s.%s/site-packages" % (gdal_base_path , sys .version_info [0 ], sys .version_info [1 ]) )
873
+ if getHelpPath ().isEmpty ():
874
+ setHelpPath ( u"%s/Resources/doc" % gdal_base_path )
867
875
868
876
869
877
# setup the MacOSX path to both GDAL executables and python modules
0 commit comments