changes to build system (uses configure)

git-svn-id: http://svn.osgeo.org/qgis/trunk@280 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
gsherman 2003-09-19 02:56:45 +00:00
parent a94e54422a
commit 51f8edcf3f
5 changed files with 2505 additions and 45 deletions

View File

@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: qgis
# Generated by qmake (1.06c) (Qt 3.2.1) on: Fri Sep 5 08:49:00 2003
# Generated by qmake (1.06c) (Qt 3.2.1) on: Thu Sep 18 18:47:10 2003
# Project: qgis.pro
# Template: subdirs
# Command: $(QMAKE) -o Makefile qgis.pro
@ -31,7 +31,7 @@ plugins/$(MAKEFILE):
sub-plugins: plugins/$(MAKEFILE) FORCE
cd plugins && $(MAKE) -f $(MAKEFILE)
Makefile: qgis.pro /usr/lib/qt3/mkspecs/default/qmake.conf
Makefile: qgis.pro /home/gsherman/qt-x11-free-3.2.1/mkspecs/default/qmake.conf
$(QMAKE) -o Makefile qgis.pro
qmake: qmake_all
@$(QMAKE) -o Makefile qgis.pro

2322
configure vendored Executable file

File diff suppressed because it is too large Load Diff

119
configure.in Normal file
View File

@ -0,0 +1,119 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(configure.in)
AC_CONFIG_COMMANDS([src/Makefile], [$QTDIR/bin/qmake -o src/Makefile src/src.pro])
dnl ---------------------------------------------------------------------------
dnl GDAL/OGR
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(gdal,
[ --with-gdal=path/gdal-config Full path to 'gdal-config' script,
e.g. '--with-gdal=/usr/local/bin/gdal-config'
],
[ if test -f "$with_gdal" ; then
GDAL_CONFIG="$with_gdal"
else
AC_MSG_ERROR("Cannot find $with_gdal")
fi
],
[
GDAL_CONFIG=`which gdal-config`
if test ! -f "$GDAL_CONFIG" ; then
AC_MSG_ERROR(["Cannot find gdal-config, try to use --with-gdal option"])
fi
]
)
AC_MSG_CHECKING([for GDAL/OGR])
if test ! -x "$GDAL_CONFIG" ; then
AC_MSG_ERROR([Cannot execute gdal-config, check permissions])
fi
if test `$GDAL_CONFIG --ogr-enabled` = "no" ; then
AC_MSG_ERROR([GDAL is compiled without OGR support.])
fi
GDAL_LIB="`$GDAL_CONFIG --libs`"
GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
AC_MSG_RESULT(yes)
AC_SUBST(GDAL_LIB)
AC_SUBST(GDAL_CFLAGS)
dnl ---------------------------------------------------------------------------
dnl PostgreSQL
dnl ---------------------------------------------------------------------------
PG_CONFIG=no
AC_ARG_WITH(pg,[ --with-pg=path/pg_config PostgreSQL (PostGIS) Support
(full path to pg_config)],,)
if test "$with_pg" = "yes" -o "$with_pg" = "" ; then
AC_PATH_PROG(PG_CONFIG, pg_config, no)
else
PG_CONFIG=$with_pg
fi
AC_MSG_CHECKING([for PostgreSQL])
if test "$PG_CONFIG" = "no" ; then
PG_LIB=
PG_INC=
AC_MSG_RESULT([no])
else
HAVE_PG=1
PG_LIB="-L`$PG_CONFIG --libdir` -lpq++"
PG_INC="`$PG_CONFIG --includedir`"
AC_MSG_RESULT([yes])
fi
AC_SUBST(HAVE_PG)
AC_SUBST(PG_INC)
AC_SUBST(PG_LIB)
dnl ---------------------------------------------------------------------------
dnl GRASS and GRASS++ package
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(grass,[ --with-grass=DIR GRASS Support
(full path to GRASS binary package, e.g.
--with-grass=/usr1/grass51/dist.i686-pc-linux-gnu])
AC_ARG_WITH(grasspp,[ --with-grasspp=DIR Full path to GRASS++ binary package])
AC_MSG_CHECKING([for GRASS])
if test -n "$with_grass"; then
# I don't know how to add library path to AC_CHECK_LIB()
GISLIB=`ls $with_grass/lib/libgrass_gis.*`
if test ! -f "$GISLIB"; then
AC_MSG_ERROR( [GRASS library not found] )
fi
GRASSPPLIB=`ls $with_grasspp/libgrass++.*`
if test ! -f "$GRASSPPLIB"; then
AC_MSG_ERROR( [GRASS++ library not found] )
fi
GRASS_LIB="-L$with_grass/lib/ -L$with_grasspp -lgrass_vect -lgrass_dig2 -lgrass_dbmiclient -lgrass_dbmibase -lgrass_shape -lgrass_dgl -lgrass_rtree -lgrass_gis -lgrass_datetime -lgrass_linkm -lgrass_form -lgrass++"
GISINC=`ls $with_grass/include/gis.h`
if test ! -f "$GISINC"; then
AC_MSG_ERROR( [GRASS headers not found] )
fi
GRASSPPINC=`ls $with_grasspp/GRASS.h`
if test ! -f "$GRASSPPINC"; then
AC_MSG_ERROR( [GRASS++ headers not found] )
fi
GRASS_INC="$with_grass/include/ $with_grasspp/"
HAVE_GRASS=1
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_SUBST(HAVE_GRASS)
AC_SUBST(GRASS_LIB)
AC_SUBST(GRASS_INC)
dnl *** Autoconf output *****************************
AC_OUTPUT([
src/platform.pro
])

15
src/platform.pro.in Normal file
View File

@ -0,0 +1,15 @@
#GDAL/OGR
GDAL_LIB = @GDAL_LIB@
GDAL_CFLAGS = @GDAL_CFLAGS@
#Postgres
HAVE_PG = @HAVE_PG@
PG_INC = @PG_INC@
PG_LIB = @PG_LIB@
#GRASS
HAVE_GRASS = @HAVE_GRASS@
GRASS_LIB = @GRASS_LIB@
GRASS_INC = @GRASS_INC@

View File

@ -2,6 +2,8 @@
# -------------------------------------------
# Subdir relative project main directory: ./src
# Target is an application: qgis
system ( echo "Creating Makefile...")
include(platform.pro)
SOURCES += main.cpp \
qgisapp.cpp \
@ -75,50 +77,52 @@ CONFIG += debug \
thread
TARGET = qgis
#.............................
# GDAL/OGR configuration
#.............................
message(Configuring GDAL)
GDALCONFIG = $$system(which gdal-config)
isEmpty(GDALCONFIG) {
error("gdal-config not found in PATH. Check GDAL installation.")
}
# check to see if ogr enabled
OGR = $$system(gdal-config --ogr-enabled)
message("OGR enabled - $$OGR")
LIBS+= $$system(gdal-config --libs)
GDALINC = $$system(gdal-config --cflags)
INCLUDEPATH += $$GDALINC
# conditional tests for optional modules
# GDAL/OGR
system ( echo " Adding GDAL support" )
QMAKE_CFLAGS += $$GDAL_CFLAGS
#message("Adding $$GDAL_CFLAGS to includes")
INCLUDEPATH += $$GDAL_CFLAGS
LIBS += $$GDAL_LIB
#.............................
#PostgreSQL support
#.............................
contains (DEFINES, POSTGRESQL){
message ("Checking PostgreSQL environment")
# Postgres
isEmpty( HAVE_PG ) {
system ( echo " Skipping PostgreSQL support" )
} else {
system( echo " Adding PostgreSQL support" )
LIBS += $$PG_LIB
INCLUDEPATH += $$PG_INC
DEFINES += POSTGRESQL HAVE_NAMESPACE_STD HAVE_CXX_STRING_HEADER DLLIMPORT=""
SOURCES += qgsdatabaselayer.cpp \
qgsdbsourceselect.cpp \
qgsnewconnection.cpp
HEADERS += qgsdbsourceselectbase.ui.h \
qgsdatabaselayer.h \
qgsdbsourceselect.h \
qgsnewconnection.h
FORMS += qgsdbsourceselectbase.ui \
qgsnewconnectionbase.ui
}
# GRASS
isEmpty( HAVE_GRASS ) {
system ( echo " Skipping GRASS support" )
} else {
system ( echo " Adding GRASS support" )
LIBS += $$GRASS_LIB
INCLUDEPATH += $$GRASS_INC
DEFINES += HAVE_GRASS
SOURCES += qgsgrassvectorlayer.cpp \
qgsgrassselect.cpp \
qgsgrassrasterlayer.cpp \
qgsgrassrastermultilayer.cpp
HEADERS += qgsgrassvectorlayer.h \
qgsgrassselect.h \
qgsgrassrasterlayer.h \
qgsgrassrastermultilayer.h
FORMS += qgsgrassselectbase.ui
}
contains ( DEFINES, POSTGRESQL ){
MYPGSQL=$$(PGSQL)
count(MYPGSQL, 1){
message ("PGSQL environment variable is defined")
message ( "Configuring to build with PostgreSQL support" )
LIBS += -L$(PGSQL)/lib -lpq++
INCLUDEPATH += $(PGSQL)/include
DEFINES += HAVE_NAMESPACE_STD HAVE_CXX_STRING_HEADER DLLIMPORT=""
SOURCES += qgsdatabaselayer.cpp \
qgsdbsourceselect.cpp \
qgsnewconnection.cpp
HEADERS += qgsdbsourceselectbase.ui.h \
qgsdatabaselayer.h \
qgsdbsourceselect.h \
qgsnewconnection.h
FORMS += qgsdbsourceselectbase.ui \
qgsnewconnectionbase.ui
}
count(MYPGSQL, 0){
message ("PGSQL environment variable is not defined. PostgreSQL excluded from build")
message ("To build with PostgreSQL support set PGSQL to point to your Postgres installation")
}
}
LANGUAGE = C++
system ( echo "Configuration complete - run make to build QGIS")