Merge pull request #1906 from davemfish/bugfix/windows-setup-py

make the setup.py GDAL library path stuff a little more bulletproof on Windows
This commit is contained in:
Doug 2025-05-09 11:38:20 -04:00 committed by GitHub
commit 851f7c70d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -24,9 +24,11 @@ if platform.system() == 'Windows':
'env variable NATCAP_INVEST_GDAL_LIB_PATH is not defined. '
'This env variable is required when building on Windows. If '
'using conda to manage your gdal installation, you may set '
'NATCAP_INVEST_GDAL_LIB_PATH="$CONDA_PREFIX/Library".')
library_dirs = [f'{os.environ["NATCAP_INVEST_GDAL_LIB_PATH"]}/lib']
include_dirs.append(f'{os.environ["NATCAP_INVEST_GDAL_LIB_PATH"]}/include')
'NATCAP_INVEST_GDAL_LIB_PATH=%CONDA_PREFIX%/Library".')
library_dirs = [os.path.join(
os.environ["NATCAP_INVEST_GDAL_LIB_PATH"].rstrip(), "lib")]
include_dirs.append(os.path.join(
os.environ["NATCAP_INVEST_GDAL_LIB_PATH"].rstrip(), "include"))
else:
compiler_args = [subprocess.run(
['gdal-config', '--cflags'], capture_output=True, text=True