Initial conversion of the build system to recognise Qt4.0.0 as a build option. For example, if you've "make install"ed Qt4, you can try using ./configure "--with-qtdir=/usr/local/Trolltech/Qt-4.0.0".

It's HIGHLY RECOMMENDED to build against Qt4 in a *copy* of your CVS working directory as you will still have to run qt3to4 from the qgis root directory (e.g. "/usr/local/Trolltech/Qt-4.0.0/bin/qt3to4 qgis.pro") before you "make", and this change is difficult to undo.

Please continue to commit new code that is Qt3.3 compatible, NOT Qt4 only.

Note that qgis doesn't actually build against Qt4 yet; this is a change to the build system only, not the code.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@3809 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
morb_au 2005-08-02 21:48:54 +00:00
parent cbae906c54
commit af0eeedab9
4 changed files with 153 additions and 177 deletions

View File

@ -149,53 +149,95 @@ AC_MSG_RESULT([$QTDIR])
# Change backslashes in QTDIR to forward slashes to prevent escaping
# problems later on in the build process, mainly for Cygwin build
# environment using MSVC as the compiler
# (include/Qt is used on Qt4)
# TODO: Use sed instead of perl
QTDIR=`echo $QTDIR | perl -p -e 's/\\\\/\\//g'`
# Check for QT includedir
if test -f $QTDIR/include/qt/qglobal.h; then
QTINC=$QTDIR/include/qt
QTVERTEST=$QTDIR/include/qt
elif test -f $QTDIR/include/qt3/qglobal.h; then
QTINC=$QTDIR/include/qt3
QTVERTEST=$QTDIR/include/qt3
elif test -f $QTDIR/include/Qt/qglobal.h; then
QTINC=$QTDIR/include
QTVERTEST=$QTDIR/include/Qt
else
QTINC=$QTDIR/include
QTVERTEST=$QTDIR/include
fi
# Figure out which version of Qt we are using
AC_MSG_CHECKING([Qt version])
QT_VER=`grep 'define.*QT_VERSION_STR\W' $QTINC/qglobal.h | perl -p -e 's/\D//g'`
QT_VER=`grep 'define.*QT_VERSION_STR\W' $QTVERTEST/qglobal.h | perl -p -e 's/\D//g'`
case "${QT_VER}" in
40*)
QT_MAJOR="4"
QT4_3SUPPORTINC=$QTDIR/include/Qt3Support
QT4_COREINC=$QTDIR/include/QtCore
QT4_DESIGNERINC=$QTDIR/include/QtDesigner
QT4_GUIINC=$QTDIR/include/QtGui
QT4_NETWORKINC=$QTDIR/include/QtNetwork
QT4_OPENGLINC=$QTDIR/include/QtOpenGL
QT4_SQLINC=$QTDIR/include/QtSql
QT4_XMLINC=$QTDIR/include/QtXml
QT4_DEFAULTINC=$QTDIR/mkspecs/default
;;
33*)
QT_MAJOR="3"
;;
32*)
QT_MAJOR="3"
;;
31*)
QT_MAJOR="3"
;;
# 32*)
# QT_MAJOR="3"
# ;;
# 31*)
# QT_MAJOR="3"
# ;;
*)
AC_MSG_ERROR([*** Qt version 3.1.x or higher is required])
AC_MSG_ERROR([*** Qt version 3.3.x or higher is required])
;;
esac
AC_MSG_RESULT([$QT_VER ($QT_MAJOR)])
# Check that moc is in path
AC_CHECK_PROG(MOC, moc, moc)
if test x$MOC = x ; then
AC_MSG_ERROR([*** moc must be in path])
if test $QT_MAJOR = "3" ; then
# Check that moc is in path
AC_CHECK_PROG(MOC, moc, moc)
if test x$MOC = x ; then
AC_MSG_ERROR([*** moc must be in path])
fi
# uic is the Qt user interface compiler
AC_CHECK_PROG(UIC, uic, uic)
if test x$UIC = x ; then
AC_MSG_ERROR([*** uic must be in path])
fi
fi
# uic is the Qt user interface compiler
AC_CHECK_PROG(UIC, uic, uic)
if test x$UIC = x ; then
AC_MSG_ERROR([*** uic must be in path])
if test $QT_MAJOR = "4" ; then
# Hard code things for the moment
# Check that moc is in path
AC_CHECK_PROG(MOC, moc, $QTDIR/bin/moc, , $QTDIR/bin)
if test x$MOC = x ; then
AC_MSG_ERROR([*** moc must be in path])
fi
# uic3 is the Qt user interface compiler in Qt3 legacy mode
AC_CHECK_PROG(UIC, uic3, $QTDIR/bin/uic3, , $QTDIR/bin)
if test x$UIC = x ; then
AC_MSG_ERROR([*** uic3 must be in path])
fi
fi
# qembed is the Qt data embedding utility.
# It is located in $QTDIR/tools/qembed, and must be compiled and installed
# manually, we'll let it slide if it isn't present
AC_CHECK_PROG(QEMBED, qembed, qembed)
### AC_CHECK_PROG(QEMBED, qembed, qembed)
# Calculate Qt include path
if test $QT_MAJOR = "3" ; then
QT_CXXFLAGS="-I$QTINC"
fi
if test $QT_MAJOR = "4" ; then
QT_CXXFLAGS="-DQT3_SUPPORT -I$QT4_DEFAULTINC -I$QT4_3SUPPORTINC -I$QT4_COREINC -I$QT4_DESIGNERINC -I$QT4_GUIINC -I$QT4_NETWORKINC -I$QT4_OPENGLINC -I$QT4_SQLINC -I$QT4_XMLINC -I$QTINC"
fi
QT_IS_EMBEDDED="no"
# On unix, figure out if we're doing a static or dynamic link
@ -258,9 +300,9 @@ case "${host}" in
;;
*)
# determin static or dynamic -- prefer dynamic
QT_IS_DYNAMIC=`ls $QTDIR/${_lib}/libqt*.so 2> /dev/null`
QT_IS_DYNAMIC=`ls $QTDIR/${_lib}/libqt*.so $QTDIR/${_lib}/libQtCore.so 2> /dev/null`
if test "x$QT_IS_DYNAMIC" = x; then
QT_IS_STATIC=`ls $QTDIR/${_lib}/libqt*.a 2> /dev/null`
QT_IS_STATIC=`ls $QTDIR/${_lib}/libqt*.a $QTDIR/${_lib}/libQtCore.a 2> /dev/null`
if test "x$QT_IS_STATIC" = x; then
QT_IS_STATIC="no"
AC_MSG_ERROR([*** Couldn't find any Qt libraries in $QTDIR/${_lib}])
@ -288,6 +330,9 @@ case "${host}" in
QT_LIB="-lqte-mt"
QT_IS_MT="yes"
QT_IS_EMBEDDED="yes"
elif test "x`ls $QTDIR/${_lib}/libQtCore.* 2> /dev/null`" != x ; then
QT_LIB="-lqt"
QT_IS_MT="yes"
fi
;;
esac

View File

@ -86,6 +86,8 @@ dnl Qt check
dnl ---------------------------------------------------------------------------
AQ_CHECK_QT
AM_CONDITIONAL([NO_UIC_IMPLEMENTATIONS], [test "$QT_MAJOR" = "4"])
dnl ---------------------------------------------------------------------------
dnl Qt/Mac check (install everything into application bundle)
dnl ---------------------------------------------------------------------------

View File

@ -29,9 +29,10 @@ WIDGETPATH=../widgets
%.uic.h: %.ui
$(UIC) -o $@ $<
if !NO_UIC_IMPLEMENTATIONS
%.uic.cpp: %.ui
$(UIC) -o $@ -impl $*.uic.h $<
endif
## main app
if HAVE_QTMAC
@ -211,8 +212,10 @@ qgis_UIC = qgisappbase.ui \
## all the ui files generate a corresponding header file
qgis_UIHEADERS = $(qgis_UIC:.ui=.uic.h)
if !NO_UIC_IMPLEMENTATIONS
## similarly all the ui files generate a corresponding implementation file
qgis_UISOURCES = $(qgis_UIC:.ui=.uic.cpp)
endif
## these are optional ancillary user-defined qtdesigner-based headers
qgis_UIH = qgisappbase.ui.h \
@ -420,7 +423,9 @@ postgresLIBSOURCES = qgspgutil.cpp
if HAVE_POSTGRESQL
postgresUIHEADERS = $(postgresUIC:.ui=.uic.h)
if !NO_UIC_IMPLEMENTATIONS
postgresUISOURCES = $(postgresUIC:.ui=.uic.cpp)
endif
postgresUIMOC = $(postgresUIC:.ui=.moc.uic.cpp)
postgresMOC = $(postgresHEADERS:.h=.moc.cpp)
@ -449,7 +454,6 @@ libqgis_la_SOURCES = \
qgisapp.cpp \
qgisapp.moc.cpp \
qgisappbase.moc.uic.cpp \
qgisappbase.uic.cpp \
qgsacetateobject.cpp \
qgsacetaterectangle.cpp \
qgsattributeaction.cpp \
@ -458,36 +462,29 @@ libqgis_la_SOURCES = \
qgscomposer.cpp \
qgscomposer.moc.cpp \
qgscomposerbase.moc.uic.cpp \
qgscomposerbase.uic.cpp \
qgscomposeritem.cpp \
qgscomposerlabel.cpp \
qgscomposerlabel.moc.cpp \
qgscomposerlabelbase.moc.uic.cpp \
qgscomposerlabelbase.uic.cpp \
qgscomposermap.cpp \
qgscomposermap.moc.cpp \
qgscomposermapbase.moc.uic.cpp \
qgscomposermapbase.uic.cpp \
qgscomposerscalebar.cpp \
qgscomposerscalebar.moc.cpp \
qgscomposerscalebarbase.moc.uic.cpp \
qgscomposerscalebarbase.uic.cpp \
qgscomposervectorlegend.cpp \
qgscomposervectorlegend.moc.cpp \
qgscomposervectorlegendbase.moc.uic.cpp \
qgscomposervectorlegendbase.uic.cpp \
qgscomposerview.cpp \
qgscomposerview.moc.cpp \
qgscomposition.cpp \
qgscomposition.moc.cpp \
qgscompositionbase.moc.uic.cpp \
qgscompositionbase.uic.cpp \
qgscontinuouscolrenderer.cpp \
qgscoordinatetransform.cpp \
qgscoordinatetransform.moc.cpp \
qgscustomprojectiondialog.cpp \
qgscustomprojectiondialogbase.moc.uic.cpp \
qgscustomprojectiondialogbase.uic.cpp \
qgscustomprojectiondialog.moc.cpp \
qgsdataprovider.moc.cpp \
qgsexception.cpp \
@ -497,7 +494,6 @@ libqgis_la_SOURCES = \
qgsfillstylewidget.cpp \
qgsfillstylewidget.moc.cpp \
qgsfillstylewidgetbase.moc.uic.cpp \
qgsfillstylewidgetbase.uic.cpp \
qgsgeometry.cpp \
qgsgeometryvertexindex.cpp \
qgsgraduatedsymrenderer.cpp \
@ -505,7 +501,6 @@ libqgis_la_SOURCES = \
qgslinestylewidget.cpp \
qgslinestylewidget.moc.cpp \
qgslinestylewidgetbase.moc.uic.cpp \
qgslinestylewidgetbase.uic.cpp \
qgsmapcanvas.cpp \
qgsmapcanvas.moc.cpp \
qgsmaplayer.cpp \
@ -520,7 +515,6 @@ libqgis_la_SOURCES = \
qgspointstylewidget.cpp \
qgspointstylewidget.moc.cpp \
qgspointstylewidgetbase.moc.uic.cpp \
qgspointstylewidgetbase.uic.cpp \
qgsprojectproperty.cpp \
qgsprovidercountcalcevent.cpp \
qgsproviderextentcalcevent.cpp \
@ -544,6 +538,20 @@ libqgis_la_SOURCES = \
qgsvectorlayer.cpp \
qgsvectorlayer.moc.cpp
if !NO_UIC_IMPLEMENTATIONS
libqgis_la_SOURCES += \
qgisappbase.uic.cpp \
qgscomposerbase.uic.cpp \
qgscomposerlabelbase.uic.cpp \
qgscomposermapbase.uic.cpp \
qgscomposerscalebarbase.uic.cpp \
qgscomposervectorlegendbase.uic.cpp \
qgscompositionbase.uic.cpp \
qgscustomprojectiondialogbase.uic.cpp \
qgsfillstylewidgetbase.uic.cpp \
qgslinestylewidgetbase.uic.cpp \
qgspointstylewidgetbase.uic.cpp
endif
if HAVE_POSTGRESQL
libqgis_la_SOURCES += $(postgresLIBSOURCES)

View File

@ -1,120 +1,3 @@
TEMPLATE = app
LANGUAGE = C++
CONFIG += qt thread rtti debug console
LIBS += $(GDAL)\lib\gdal_i.lib $(POSTGRESQL)\src\interfaces\libpq\Release\libpq.lib $(GEOS)\lib\geos.lib
DEFINES += QGISDEBUG
INCLUDEPATH += . $(GDAL)\include $(POSTGRESQL)\src\interfaces\libpq $(POSTGRESQL)\src\include $(GEOS)\include
HEADERS += qgscolortable.h
SOURCES += main.cpp \
qgisapp.cpp \
qgisiface.cpp \
qgisinterface.cpp \
qgsattributeaction.cpp \
qgsattributeactiondialog.cpp \
qgsattributedialog.cpp \
qgsattributetable.cpp \
qgsattributetabledisplay.cpp \
qgscontcoldialog.cpp \
qgscontinuouscolrenderer.cpp \
qgscoordinatetransform.cpp \
qgscustomsymbol.cpp \
qgsdatasource.cpp \
qgsdbsourceselect.cpp \
qgsdlgvectorlayerproperties.cpp \
qgsfeature.cpp \
qgsfeatureattribute.cpp \
qgsfield.cpp \
qgsgraduatedmarenderer.cpp \
qgsgraduatedsymrenderer.cpp \
qgsgramadialog.cpp \
qgsgramaextensionwidget.cpp \
qgsgrasydialog.cpp \
qgshelpviewer.cpp \
qgsidentifyresults.cpp \
qgslegend.cpp \
qgslegenditem.cpp \
qgslinestyledialog.cpp \
qgslinesymbol.cpp \
qgsmapcanvas.cpp \
qgsmaplayer.cpp \
qgsmaplayerregistry.cpp \
qgsmapserverexport.cpp \
qgsmarkerdialog.cpp \
qgsmarkersymbol.cpp \
qgsnewconnection.cpp \
qgsoptions.cpp \
qgspatterndialog.cpp \
qgspgquerybuilder.cpp \
qgspluginitem.cpp \
qgspluginmanager.cpp \
qgspluginmetadata.cpp \
qgspluginregistry.cpp \
qgspoint.cpp \
qgspolygonsymbol.cpp \
qgsproject.cpp \
qgsprojectproperties.cpp \
qgsprovidermetadata.cpp \
qgsproviderregistry.cpp \
qgsrangerenderitem.cpp \
qgsrasterlayer.cpp \
qgsrasterlayerproperties.cpp \
qgsrect.cpp \
qgsrenderitem.cpp \
qgsscalecalculator.cpp \
qgssimadialog.cpp \
qgssimarenderer.cpp \
qgssinglesymrenderer.cpp \
qgssisydialog.cpp \
qgssymbol.cpp \
qgssymbologyutils.cpp \
qgsvectorlayer.cpp \
qgssvgcache.cpp \
splashscreen.cpp \
qgsacetateobject.cpp \
qgslabeldialog.cpp \
qgslabel.cpp \
qgslabelattributes.cpp \
qgsacetaterectangle.cpp \
qgsuvaldialog.cpp \
qgsludialog.cpp \
qgsuniquevalrenderer.cpp \
qgsuvalmadialog.cpp \
qgsuvalmarenderer.cpp \
qgsvectorfilewriter.cpp \
qgsgeomtypedialog.cpp
FORMS = qgisappbase.ui \
qgsabout.ui \
qgsattributetablebase.ui \
qgsattributeactiondialogbase.ui \
qgsattributedialogbase.ui \
qgscontcoldialogbase.ui \
qgsdbsourceselectbase.ui \
qgsdlgvectorlayerpropertiesbase.ui \
qgsgramadialogbase.ui \
qgsgrasydialogbase.ui \
qgshelpviewerbase.ui \
qgsidentifyresultsbase.ui \
qgslegenditembase.ui \
qgslinestyledialogbase.ui \
qgsmapserverexportbase.ui \
qgsmarkerdialogbase.ui \
qgsmessageviewer.ui \
qgsnewconnectionbase.ui \
qgsoptionsbase.ui \
qgspatterndialogbase.ui \
qgspgquerybuilderbase.ui \
qgspluginmanagerbase.ui \
qgsprojectpropertiesbase.ui \
qgsrasterlayerpropertiesbase.ui \
qgslabeldialogbase.ui
######################################################################
# Qmake project file for QGIS src directory
# This file is used by qmake to generate the Makefile for building
@ -144,13 +27,33 @@ FORMS = qgisappbase.ui \
# The headers/lib can be downloaded from http://qgis.org/win32_geos.zip #
###########################################################################
TEMPLATE = app
LANGUAGE = C++
CONFIG += qt thread rtti debug console
LIBS += $(GDAL)\lib\gdal_i.lib $(POSTGRESQL)\src\interfaces\libpq\Release\libpq.lib $(GEOS)\lib\geos.lib
DEFINES += QGISDEBUG
INCLUDEPATH += . $(GDAL)\include $(POSTGRESQL)\src\interfaces\libpq $(POSTGRESQL)\src\include $(GEOS)\include
TARGET = qgis
DEFINES+= QGISDEBUG
DESTDIR = ../win_build
#CONFIG += qt thread rtti console
RC_FILE = qgis_win32.rc
# Input
HEADERS += qgis.h \
HEADERS += legend/qgslegend.h \
legend/qgslegendgroup.h \
legend/qgslegenditem.h \
legend/qgslegendlayer.h \
legend/qgslegendlayerfile.h \
legend/qgslegendpropertygroup.h \
legend/qgslegendpropertyitem.h \
legend/qgslegendsymbologygroup.h \
legend/qgslegendsymbologyitem.h \
legend/qgslegendvectorsymbologyitem.h \
qgis.h \
qgisapp.h \
qgisappbase.ui.h \
qgisiface.h \
@ -162,7 +65,7 @@ HEADERS += qgis.h \
qgsattributetablebase.ui.h \
qgsattributetabledisplay.h \
qgsattributedialog.h \
qgsconfig.h \
qgscolortable.h \
qgscontcoldialog.h \
qgscontinuouscolrenderer.h \
qgscoordinatetransform.h \
@ -175,16 +78,12 @@ HEADERS += qgis.h \
qgsfeature.h \
qgsfeatureattribute.h \
qgsfield.h \
qgsgraduatedmarenderer.h \
qgsgeomtypedialog.h \
qgsgraduatedsymrenderer.h \
qgsgramadialog.h \
qgsgramaextensionwidget.h \
qgsgrasydialog.h \
qgshelpviewer.h \
qgshelpviewerbase.ui.h \
qgsidentifyresults.h \
qgslegend.h \
qgslegenditem.h \
qgslinestyledialog.h \
qgslinesymbol.h \
qgsmapcanvas.h \
@ -220,8 +119,6 @@ HEADERS += qgis.h \
qgsrenderer.h \
qgsrenderitem.h \
qgsscalecalculator.h \
qgssimadialog.h \
qgssimarenderer.h \
qgssinglesymrenderer.h \
qgssisydialog.h \
qgssymbol.h \
@ -230,7 +127,6 @@ HEADERS += qgis.h \
qgsvectordataprovider.h \
qgsvectorlayer.h \
qgssvgcache.h \
splashscreen.h \
qgsacetateobject.h \
qgslabel.h \
qgslabelattributes.h \
@ -239,11 +135,10 @@ HEADERS += qgis.h \
qgsuvaldialog.h \
qgsludialog.h \
qgsuniquevalrenderer.h \
qgsuvalmadialog.h \
qgsuvalmarenderer.h \
qgscolortable.h \
qgsvectorfilewriter.h \
qgsgeomtINTERFACES += qgisappbase.ui \
splashscreen.h
INTERFACES += qgisappbase.ui \
qgsabout.ui \
qgsattributetablebase.ui \
qgsattributeactiondialogbase.ui \
@ -273,7 +168,19 @@ HEADERS += qgis.h \
qgsludialogbase.ui \
qgsuvaldialogbase.ui \
qgsuvalmadialogbase.ui \
qgsgeomtypediSOURCES += main.cpp \
qgsgeomtypedialog.ui
SOURCES += legend/qgslegend.cpp \
legend/qgslegendgroup.cpp \
legend/qgslegenditem.cpp \
legend/qgslegendlayer.cpp \
legend/qgslegendlayerfile.cpp \
legend/qgslegendpropertygroup.cpp \
legend/qgslegendpropertyitem.cpp \
legend/qgslegendsymbologygroup.cpp \
legend/qgslegendsymbologyitem.cpp \
legend/qgslegendvectorsymbologyitem.cpp \
main.cpp \
qgisapp.cpp \
qgisiface.cpp \
qgisinterface.cpp \
@ -282,6 +189,7 @@ HEADERS += qgis.h \
qgsattributedialog.cpp \
qgsattributetable.cpp \
qgsattributetabledisplay.cpp \
qgscolortable.h \
qgscontcoldialog.cpp \
qgscontinuouscolrenderer.cpp \
qgscoordinatetransform.cpp \
@ -292,15 +200,11 @@ HEADERS += qgis.h \
qgsfeature.cpp \
qgsfeatureattribute.cpp \
qgsfield.cpp \
qgsgraduatedmarenderer.cpp \
qgsgeomtypedialog.cpp \
qgsgraduatedsymrenderer.cpp \
qgsgramadialog.cpp \
qgsgramaextensionwidget.cpp \
qgsgrasydialog.cpp \
qgshelpviewer.cpp \
qgsidentifyresults.cpp \
qgslegend.cpp \
qgslegenditem.cpp \
qgslinestyledialog.cpp \
qgslinesymbol.cpp \
qgsmapcanvas.cpp \
@ -329,15 +233,12 @@ HEADERS += qgis.h \
qgsrect.cpp \
qgsrenderitem.cpp \
qgsscalecalculator.cpp \
qgssimadialog.cpp \
qgssimarenderer.cpp \
qgssinglesymrenderer.cpp \
qgssisydialog.cpp \
qgssymbol.cpp \
qgssymbologyutils.cpp \
qgsvectorlayer.cpp \
qgssvgcache.cpp \
splashscreen.cpp \
qgsacetateobject.cpp \
qgslabeldialog.cpp \
qgslabel.cpp \
@ -346,9 +247,29 @@ HEADERS += qgis.h \
qgsuvaldialog.cpp \
qgsludialog.cpp \
qgsuniquevalrenderer.cpp \
qgsuvalmadialog.cpp \
qgsuvalmarenderer.cpp \
qgscolortable.h \
qgsvectorfilewriter.cpp \
qgsgeomtypedialog.cpp
splashscreen.cpp
FORMS = qgisappbase.ui \
qgsabout.ui \
qgsattributetablebase.ui \
qgsattributeactiondialogbase.ui \
qgsattributedialogbase.ui \
qgscontcoldialogbase.ui \
qgsdbsourceselectbase.ui \
qgsdlgvectorlayerpropertiesbase.ui \
qgsgrasydialogbase.ui \
qgshelpviewerbase.ui \
qgsidentifyresultsbase.ui \
qgslabeldialogbase.ui \
qgslinestyledialogbase.ui \
qgsmapserverexportbase.ui \
qgsmarkerdialogbase.ui \
qgsmessageviewer.ui \
qgsnewconnectionbase.ui \
qgsoptionsbase.ui \
qgspatterndialogbase.ui \
qgspgquerybuilderbase.ui \
qgspluginmanagerbase.ui \
qgsprojectpropertiesbase.ui \
qgsrasterlayerpropertiesbase.ui