Skip to content

Commit 66a01d5

Browse files
committed
Install gdal python bindings in venv
1 parent c62dcd3 commit 66a01d5

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

SuperBuild/cmake/External-GDAL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ExternalProject_Add(${_proj_name}
1616
CMAKE_ARGS
1717
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
1818
-DCMAKE_INSTALL_PREFIX:PATH=${SB_INSTALL_DIR}
19-
-DGDAL_PYTHON_INSTALL_PREFIX=${SB_INSTALL_DIR}
19+
-DGDAL_PYTHON_INSTALL_PREFIX=${PYTHON_HOME}
2020
-DBUILD_PYTHON_BINDINGS=ON
2121
${WIN32_CMAKE_ARGS}
2222
#--Build step-----------------

configure.sh

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Ensure the DEBIAN_FRONTEND environment variable is set for apt-get calls
44
APT_GET="env DEBIAN_FRONTEND=noninteractive $(command -v apt-get)"
55

6-
check_version(){
6+
check_version(){
77
UBUNTU_VERSION=$(lsb_release -r)
88
case "$UBUNTU_VERSION" in
99
*"20.04"*|*"21.04"*|*"24.04"*)
@@ -107,15 +107,15 @@ installruntimedepsonly() {
107107

108108
installreqs() {
109109
cd /code
110-
110+
111111
## Set up library paths
112112
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RUNPATH/SuperBuild/install/lib
113113

114114
## Before installing
115115
echo "Updating the system"
116116
ensure_prereqs
117117
check_version
118-
118+
119119
echo "Installing Required Requisites"
120120
installdepsfromsnapcraft build prereqs
121121
echo "Installing OpenCV Dependencies"
@@ -126,7 +126,7 @@ installreqs() {
126126
installdepsfromsnapcraft build openmvs
127127
echo "Installing GDAL Dependencies"
128128
installdepsfromsnapcraft build gdal
129-
129+
130130
set -e
131131

132132
# edt requires numpy to build
@@ -135,15 +135,13 @@ installreqs() {
135135
}
136136

137137
installpython() {
138-
echo "Installing Python requirements with compiled GDAL"
138+
echo "Installing Python requirements"
139139
cd /code
140-
export GDAL_CONFIG=${RUNPATH}/SuperBuild/install/bin/gdal-config
141-
142140
set -e
143141
venv/bin/pip install -r requirements.txt --ignore-installed
144142
set +e
145143
}
146-
144+
147145
install() {
148146
installreqs
149147

@@ -160,15 +158,10 @@ install() {
160158
fi
161159

162160
set -eo pipefail
163-
164161
echo "Compiling SuperBuild"
165162
cd ${RUNPATH}/SuperBuild
166163
mkdir -p build && cd build
167-
cmake .. \
168-
-DBUILD_PYTHON_BINDINGS=ON \
169-
-DPython_ROOT=/code/venv \
170-
-DPython_FIND_VIRTUALENV=ONLY \
171-
&& make -j$processes
164+
cmake .. && make -j$processes
172165

173166
# Reset terminal state
174167
cd ${RUNPATH}
@@ -178,7 +171,7 @@ install() {
178171

179172
echo "Configuration Finished"
180173
}
181-
174+
182175
uninstall() {
183176
check_version
184177

0 commit comments

Comments
 (0)