@@ -183,37 +183,33 @@ def build(self, installdir=None, njobs=1):
183
183
# Download and extract zip file if not present.
184
184
zipfold = os .path .join (self .root , "geos-{0}" .format (self .version ))
185
185
self .extract (overwrite = True )
186
+ version = self .version_tuple
186
187
187
- # Define build directory.
188
+ # Define build and install directory.
188
189
builddir = os .path .join (zipfold , "build" )
189
-
190
- # Define installation directory.
191
190
if installdir is None :
192
191
installdir = os .path .expanduser ("~/.local/share/libgeos" )
193
192
installdir = os .path .abspath (installdir )
194
193
195
- # Define configure options.
194
+ # Define generic configure and build options.
196
195
config_opts = [
197
- "-DCMAKE_INSTALL_PREFIX={0}" .format (installdir ),
198
196
"-DCMAKE_BUILD_TYPE=Release" ,
197
+ "-DCMAKE_INSTALL_PREFIX={0}" .format (installdir ),
198
+ "-D{0}=OFF" .format ("GEOS_ENABLE_TESTS" if version < (3 , 8 , 0 )
199
+ else "BUILD_TESTING" )
199
200
]
200
- if self .version_tuple < (3 , 8 , 0 ):
201
- config_opts += ["-DGEOS_ENABLE_TESTS=OFF" ]
202
- else :
203
- config_opts += ["-DBUILD_TESTING=OFF" ]
204
- if os .name == "nt" and self .version_tuple < (3 , 6 , 0 ):
205
- config_opts = ["-G" , "NMake Makefiles" ] + config_opts
206
-
207
- # Define build options.
208
- build_env = os .environ .copy ()
209
201
build_opts = [
210
202
"--config" , "Release" ,
211
203
"--target" , "install" ,
212
204
]
205
+ build_env = os .environ .copy ()
206
+
207
+ # Define custom configure and build options.
213
208
if os .name != "nt" :
214
209
build_env ["MAKEFLAGS" ] = "-j {0:d}" .format (njobs )
215
- elif self . version_tuple < (3 , 6 , 0 ):
210
+ elif version < (3 , 6 , 0 ):
216
211
win64 = (8 * struct .calcsize ("P" ) == 64 )
212
+ config_opts = ["-G" , "NMake Makefiles" ] + config_opts
217
213
build_opts .extend ([
218
214
"--" ,
219
215
"WIN64={0}" .format ("YES" if win64 else "NO" ),
0 commit comments