Skip to content

Commit

Permalink
Fix processing gdal algs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 8, 2025
1 parent f4d548a commit 3cd70c5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
37 changes: 37 additions & 0 deletions cmake/VcpkgInstallDeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,40 @@ if(WITH_BINDINGS)
DESTINATION "${_TARGET_PYTHON_DIR}"
PATTERN "*.sip" EXCLUDE)
endif()

set(BUNDLED_EXECUTABLES
"tools/gdal/gdal_contour"
"tools/gdal/gdal_create"
"tools/gdal/gdal_footprint"
"tools/gdal/gdal_grid"
"tools/gdal/gdal_rasterize"
"tools/gdal/gdal_translate"
"tools/gdal/gdal_viewshed"
"tools/gdal/gdaladdo"
"tools/gdal/gdalbuildvrt"
"tools/gdal/gdaldem"
"tools/gdal/gdalenhance"
"tools/gdal/gdalinfo"
"tools/gdal/gdallocationinfo"
"tools/gdal/gdalmanage"
"tools/gdal/gdalmdiminfo"
"tools/gdal/gdalmdimtranslate"
"tools/gdal/gdalsrsinfo"
"tools/gdal/gdaltindex"
"tools/gdal/gdaltransform"
"tools/gdal/gdalwarp"
"tools/gdal/gnmanalyse"
"tools/gdal/gnmmanage"
"tools/gdal/nearblack"
"tools/gdal/ogr2ogr"
"tools/gdal/ogrinfo"
"tools/gdal/ogrlineref"
"tools/gdal/ogrtindex"
"tools/gdal/sozip"
)
if(NOT MSVC)
list(TRANSFORM BUNDLED_EXECUTABLES PREPEND "${VCPKG_BASE_DIR}/")
install(PROGRAMS ${BUNDLED_EXECUTABLES}
DESTINATION "${QGIS_BIN_SUBDIR}")
endif()

7 changes: 2 additions & 5 deletions python/plugins/processing/algs/gdal/GdalUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,11 @@ def runGdal(commands, feedback=None):
except OSError: # https://travis-ci.org/m-kuhn/QGIS#L1493-L1526
pass
if isDarwin and os.path.isfile(
os.path.join(QgsApplication.prefixPath(), "bin", "gdalinfo")
os.path.join(QgsApplication.prefixPath(), "Contents", "MacOS", "gdalinfo")
):
# Looks like there's a bundled gdal. Let's use it.
os.environ["PATH"] = "{}{}{}".format(
os.path.join(QgsApplication.prefixPath(), "bin"), os.pathsep, envval
)
os.environ["DYLD_LIBRARY_PATH"] = os.path.join(
QgsApplication.prefixPath(), "lib"
os.path.join(QgsApplication.prefixPath(), "Contents", "MacOS"), os.pathsep, envval
)
else:
# Other platforms should use default gdal finder codepath
Expand Down
3 changes: 2 additions & 1 deletion vcpkg/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"name": "gdal",
"default-features": false,
"features": [
"poppler"
"poppler",
"tools"
]
},
"geos",
Expand Down

0 comments on commit 3cd70c5

Please sign in to comment.