./configure --help
Among other options, there are three that are important to
the success of the build:
--with-qtdir=DIR Qt installation directory default=$QTDIR
--with-gdal=path/gdal-config Full path to 'gdal-config' script,
e.g. '--with-gdal=/usr/local/bin/gdal-config'
--with-pg=path/pg_config PostgreSQL (PostGIS) Support
(full path to pg_config)
--with-grass=DIR GRASS Support (full path to GRASS binary package)