@@ -183,37 +183,33 @@ def build(self, installdir=None, njobs=1):
183183 # Download and extract zip file if not present.
184184 zipfold = os .path .join (self .root , "geos-{0}" .format (self .version ))
185185 self .extract (overwrite = True )
186+ version = self .version_tuple
186187
187- # Define build directory.
188+ # Define build and install directory.
188189 builddir = os .path .join (zipfold , "build" )
189-
190- # Define installation directory.
191190 if installdir is None :
192191 installdir = os .path .expanduser ("~/.local/share/libgeos" )
193192 installdir = os .path .abspath (installdir )
194193
195- # Define configure options.
194+ # Define generic configure and build options.
196195 config_opts = [
197- "-DCMAKE_INSTALL_PREFIX={0}" .format (installdir ),
198196 "-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" )
199200 ]
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 ()
209201 build_opts = [
210202 "--config" , "Release" ,
211203 "--target" , "install" ,
212204 ]
205+ build_env = os .environ .copy ()
206+
207+ # Define custom configure and build options.
213208 if os .name != "nt" :
214209 build_env ["MAKEFLAGS" ] = "-j {0:d}" .format (njobs )
215- elif self . version_tuple < (3 , 6 , 0 ):
210+ elif version < (3 , 6 , 0 ):
216211 win64 = (8 * struct .calcsize ("P" ) == 64 )
212+ config_opts = ["-G" , "NMake Makefiles" ] + config_opts
217213 build_opts .extend ([
218214 "--" ,
219215 "WIN64={0}" .format ("YES" if win64 else "NO" ),
0 commit comments