From 3ff24fff7e96573e13e2cf5cb5dc62f104665fbd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 11 Dec 2009 18:43:42 +0000 Subject: [PATCH] 2009-12-11 19:41 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/Makefile * contrib/hbqt/detect.mk + contrib/hbqt/moc.mk * contrib/hbqt/hbqts/Makefile * contrib/hbqt/qtgui/qtguis/Makefile * contrib/hbqt/qtgui/Makefile * contrib/hbqt/qtcore/qtcores/Makefile * contrib/hbqt/qtcore/Makefile * contrib/hbqt/qtnetwork/qtnetworks/Makefile * contrib/hbqt/qtnetwork/Makefile + Moved 'moc' build logic to separate file. + Added support for MOC_HEADERS in all sub-libs. This allows to avoid hacks to place every custom created component in central lib. (It probably allows to avoid central lib altogether.) ! Fixed broken static build after recent changes. (I've readded central filelist.mk to avoid redundancy, but the file isn't an automatically generated one anymore) % Optimized build to not provide all subsystem header dirs for each QT sub-libs, only those which are needed. Now QtCore header dir is passed to all components, but QtGui and QtNetwork is passed only to these subcomponents. Central hbqt lib gets all dirs, but hopefully this will be cleaned eventually. % Cleaned to not use /Qt include dir. It's apparently not needed. * contrib/hbqt/qth/QObject.qth * contrib/hbqt/qtcore/QObject.cpp ! Core component was referring to a GUI one, and hbqt_par_QWidget() was used to retieve a QObject inside QObject wrappers. Please fix me if it was intentional, but it didn't look right and came out after cleaning header dir usage. * contrib/hbide/hbide.hbp + Added MSVC link switched sent by Andi to make QT 4.6.0 libs to default Harbour build. --- harbour/ChangeLog | 41 +++++++++++++++++++ harbour/contrib/hbide/hbide.hbp | 4 ++ harbour/contrib/hbqt/Makefile | 29 +------------ harbour/contrib/hbqt/detect.mk | 17 ++++++-- harbour/contrib/hbqt/hbqts/Makefile | 4 +- harbour/contrib/hbqt/moc.mk | 12 ++++++ harbour/contrib/hbqt/qtcore/Makefile | 1 + harbour/contrib/hbqt/qtcore/QObject.cpp | 3 +- harbour/contrib/hbqt/qtcore/qtcores/Makefile | 1 + harbour/contrib/hbqt/qtgui/Makefile | 1 + harbour/contrib/hbqt/qtgui/qtguis/Makefile | 1 + harbour/contrib/hbqt/qth/QObject.qth | 3 +- harbour/contrib/hbqt/qtnetwork/Makefile | 1 + .../hbqt/qtnetwork/qtnetworks/Makefile | 1 + 14 files changed, 82 insertions(+), 37 deletions(-) create mode 100644 harbour/contrib/hbqt/moc.mk diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b42f465c40..4de6764408 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,47 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-11 19:41 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/Makefile + * contrib/hbqt/detect.mk + + contrib/hbqt/moc.mk + * contrib/hbqt/hbqts/Makefile + * contrib/hbqt/qtgui/qtguis/Makefile + * contrib/hbqt/qtgui/Makefile + * contrib/hbqt/qtcore/qtcores/Makefile + * contrib/hbqt/qtcore/Makefile + * contrib/hbqt/qtnetwork/qtnetworks/Makefile + * contrib/hbqt/qtnetwork/Makefile + + Moved 'moc' build logic to separate file. + + Added support for MOC_HEADERS in all sub-libs. + This allows to avoid hacks to place every custom + created component in central lib. (It probably allows + to avoid central lib altogether.) + ! Fixed broken static build after recent changes. + (I've readded central filelist.mk to avoid + redundancy, but the file isn't an automatically + generated one anymore) + % Optimized build to not provide all subsystem header + dirs for each QT sub-libs, only those which are needed. + Now QtCore header dir is passed to all components, + but QtGui and QtNetwork is passed only to these + subcomponents. + Central hbqt lib gets all dirs, but hopefully this + will be cleaned eventually. + % Cleaned to not use /Qt include dir. It's apparently + not needed. + + * contrib/hbqt/qth/QObject.qth + * contrib/hbqt/qtcore/QObject.cpp + ! Core component was referring to a GUI one, and hbqt_par_QWidget() + was used to retieve a QObject inside QObject wrappers. + Please fix me if it was intentional, but it didn't look right and + came out after cleaning header dir usage. + + * contrib/hbide/hbide.hbp + + Added MSVC link switched sent by Andi to make QT 4.6.0 + libs to default Harbour build. + 2009-12-11 18:17 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * include/hbwinuni.h + Added HB_ARRAYSETSTR*(). Based on Przemek's post. diff --git a/harbour/contrib/hbide/hbide.hbp b/harbour/contrib/hbide/hbide.hbp index 9066173869..638d2130c5 100644 --- a/harbour/contrib/hbide/hbide.hbp +++ b/harbour/contrib/hbide/hbide.hbp @@ -10,6 +10,10 @@ -ohbide +# Trick to make it link using default Harbour builds +-ldflag={msvc}-nodefaultlib:msvcrt.lib +-ldflag={msvc}-defaultlib:libcmt.lib + hbide.prg idestylesheets.prg idetags.prg diff --git a/harbour/contrib/hbqt/Makefile b/harbour/contrib/hbqt/Makefile index 9b4e199d4d..cea9168e97 100644 --- a/harbour/contrib/hbqt/Makefile +++ b/harbour/contrib/hbqt/Makefile @@ -15,34 +15,9 @@ include $(TOP)$(ROOT)contrib/hbqt/detect.mk ifneq ($(HB_HAS_QT),) - MOC_HEADERS := \ - hbqt_events.h \ - hbqt_hbdbfmodel.h \ - hbqt_hbqmainwindow.h \ - hbqt_hbqsyntaxhighlighter.h \ - hbqt_hbqtableview.h \ - hbqt_slots.h \ - - CPP_SOURCES := \ - hbqt_base.cpp \ - hbqt_utils.cpp \ - hbqt_slots.cpp \ - hbqt_destruct.cpp \ - hbqt_events.cpp \ - hbqt_hbdbfmodel.cpp \ - hbqt_hbqmainwindow.cpp \ - hbqt_hbqsyntaxhighlighter.cpp \ - hbqt_hbqtableview.cpp \ - -MOC_CPP_SOURCES := $(foreach dir,$(MOC_HEADERS),moc_$(dir:.h=.cpp)) - -$(MOC_CPP_SOURCES) : moc_%.cpp : $(GRANDP)%.h - -moc_%.cpp : $(GRANDP)%.h - $(MOC_BIN) $? -o $@ - - CPP_SOURCES += $(MOC_CPP_SOURCES) + include $(TOP)$(ROOT)contrib/hbqt/filelist.mk + include $(TOP)$(ROOT)contrib/hbqt/moc.mk include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk diff --git a/harbour/contrib/hbqt/detect.mk b/harbour/contrib/hbqt/detect.mk index b276304f9d..cf3fd96366 100644 --- a/harbour/contrib/hbqt/detect.mk +++ b/harbour/contrib/hbqt/detect.mk @@ -30,10 +30,21 @@ endif ifneq ($(HB_HAS_QT),) ifeq ($(_QT_DARWIN),yes) HB_CFLAGS += -I/Library/Frameworks/QtCore.framework/Headers - HB_CFLAGS += -I/Library/Frameworks/QtGui.framework/Headers - HB_CFLAGS += -I/Library/Frameworks/QtNetwork.framework/Headers + ifneq ($(filter $(LIBNAME),hbqt hbqtgui hbqtgui),) + HB_CFLAGS += -I/Library/Frameworks/QtGui.framework/Headers + endif + ifneq ($(filter $(LIBNAME),hbqt hbqtnetwork hbqtnetworks),) + HB_CFLAGS += -I/Library/Frameworks/QtNetwork.framework/Headers + endif else - HB_CFLAGS += $(foreach d,$(HB_HAS_QT),-I$(d) -I$(d)/Qt -I$(d)/QtCore -I$(d)/QtGui -I$(d)/QtNetwork) + HB_CFLAGS += $(foreach d,$(HB_HAS_QT),-I$(d)) + HB_CFLAGS += $(foreach d,$(HB_HAS_QT),-I$(d)/QtCore) + ifneq ($(filter $(LIBNAME),hbqt hbqtgui hbqtgui),) + HB_CFLAGS += $(foreach d,$(HB_HAS_QT),-I$(d)/QtGui) + endif + ifneq ($(filter $(LIBNAME),hbqt hbqtnetwork hbqtnetworks),) + HB_CFLAGS += $(foreach d,$(HB_HAS_QT),-I$(d)/QtNetwork) + endif endif # Locate 'moc' executable diff --git a/harbour/contrib/hbqt/hbqts/Makefile b/harbour/contrib/hbqt/hbqts/Makefile index d5e4d64aaa..9eae96ccd4 100644 --- a/harbour/contrib/hbqt/hbqts/Makefile +++ b/harbour/contrib/hbqt/hbqts/Makefile @@ -17,11 +17,9 @@ ifneq ($(HB_HAS_QT),) HB_CFLAGS += -DQT_NODLL -moc_slots.cpp : $(TOP)$(ROOT)contrib/hbqt/hbqt_slots.h - $(MOC_BIN) $(TOP)$(ROOT)contrib/hbqt/hbqt_slots.h > moc_slots.cpp - include $(TOP)$(ROOT)contrib/hbqt/filelist.mk + include $(TOP)$(ROOT)contrib/hbqt/moc.mk include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk endif diff --git a/harbour/contrib/hbqt/moc.mk b/harbour/contrib/hbqt/moc.mk new file mode 100644 index 0000000000..cb8421f241 --- /dev/null +++ b/harbour/contrib/hbqt/moc.mk @@ -0,0 +1,12 @@ +# +# $Id$ +# + +MOC_CPP_SOURCES := $(foreach dir,$(MOC_HEADERS),moc_$(dir:.h=.cpp)) + +$(MOC_CPP_SOURCES) : moc_%.cpp : $(GRANDP)%.h + +CPP_SOURCES += $(MOC_CPP_SOURCES) + +moc_%.cpp : $(GRANDP)%.h + $(MOC_BIN) $? -o $@ diff --git a/harbour/contrib/hbqt/qtcore/Makefile b/harbour/contrib/hbqt/qtcore/Makefile index a279166436..6a1bf75f30 100644 --- a/harbour/contrib/hbqt/qtcore/Makefile +++ b/harbour/contrib/hbqt/qtcore/Makefile @@ -14,6 +14,7 @@ ifneq ($(HB_HAS_QT),) include $(TOP)$(ROOT)contrib/hbqt/qtcore/filelist.mk + include $(TOP)$(ROOT)contrib/hbqt/moc.mk include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk diff --git a/harbour/contrib/hbqt/qtcore/QObject.cpp b/harbour/contrib/hbqt/qtcore/QObject.cpp index ad700cc629..cab7e6ba0a 100644 --- a/harbour/contrib/hbqt/qtcore/QObject.cpp +++ b/harbour/contrib/hbqt/qtcore/QObject.cpp @@ -85,7 +85,6 @@ #include -#include #include #include @@ -154,7 +153,7 @@ HB_FUNC( QT_QOBJECT ) { void * pObj = NULL; - pObj = ( QObject* ) new QObject( hbqt_par_QWidget( 1 ) ) ; + pObj = ( QObject* ) new QObject( hbqt_par_QObject( 1 ) ) ; hb_retptrGC( gcAllocate_QObject( pObj ) ); } diff --git a/harbour/contrib/hbqt/qtcore/qtcores/Makefile b/harbour/contrib/hbqt/qtcore/qtcores/Makefile index 4c6a118cb4..278090c9d2 100644 --- a/harbour/contrib/hbqt/qtcore/qtcores/Makefile +++ b/harbour/contrib/hbqt/qtcore/qtcores/Makefile @@ -19,6 +19,7 @@ ifneq ($(HB_HAS_QT),) include $(TOP)$(ROOT)contrib/hbqt/qtcore/filelist.mk + include $(TOP)$(ROOT)contrib/hbqt/moc.mk include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk else diff --git a/harbour/contrib/hbqt/qtgui/Makefile b/harbour/contrib/hbqt/qtgui/Makefile index 0e290e9502..e53c75a7ac 100644 --- a/harbour/contrib/hbqt/qtgui/Makefile +++ b/harbour/contrib/hbqt/qtgui/Makefile @@ -14,6 +14,7 @@ ifneq ($(HB_HAS_QT),) include $(TOP)$(ROOT)contrib/hbqt/qtgui/filelist.mk + include $(TOP)$(ROOT)contrib/hbqt/moc.mk include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk diff --git a/harbour/contrib/hbqt/qtgui/qtguis/Makefile b/harbour/contrib/hbqt/qtgui/qtguis/Makefile index 8ca35003f0..e69d4aa217 100644 --- a/harbour/contrib/hbqt/qtgui/qtguis/Makefile +++ b/harbour/contrib/hbqt/qtgui/qtguis/Makefile @@ -19,6 +19,7 @@ ifneq ($(HB_HAS_QT),) include $(TOP)$(ROOT)contrib/hbqt/qtgui/filelist.mk + include $(TOP)$(ROOT)contrib/hbqt/moc.mk include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk else diff --git a/harbour/contrib/hbqt/qth/QObject.qth b/harbour/contrib/hbqt/qth/QObject.qth index 478c4322e2..47d959a487 100644 --- a/harbour/contrib/hbqt/qth/QObject.qth +++ b/harbour/contrib/hbqt/qth/QObject.qth @@ -60,7 +60,6 @@ Calls = QT_Qbject -#include #include #include @@ -70,7 +69,7 @@ Calls = QT_Qbject */ HB_FUNC( QT_QOBJECT ) { - hb_retptr( ( QObject* ) new QObject( hbqt_par_QWidget( 1 ) ) ); + hb_retptr( ( QObject* ) new QObject( hbqt_par_QObject( 1 ) ) ); } diff --git a/harbour/contrib/hbqt/qtnetwork/Makefile b/harbour/contrib/hbqt/qtnetwork/Makefile index 860fcd82e0..d02d14a76f 100644 --- a/harbour/contrib/hbqt/qtnetwork/Makefile +++ b/harbour/contrib/hbqt/qtnetwork/Makefile @@ -14,6 +14,7 @@ ifneq ($(HB_HAS_QT),) include $(TOP)$(ROOT)contrib/hbqt/qtnetwork/filelist.mk + include $(TOP)$(ROOT)contrib/hbqt/moc.mk include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk diff --git a/harbour/contrib/hbqt/qtnetwork/qtnetworks/Makefile b/harbour/contrib/hbqt/qtnetwork/qtnetworks/Makefile index d11753ad1f..cf6c3174fc 100644 --- a/harbour/contrib/hbqt/qtnetwork/qtnetworks/Makefile +++ b/harbour/contrib/hbqt/qtnetwork/qtnetworks/Makefile @@ -19,6 +19,7 @@ ifneq ($(HB_HAS_QT),) include $(TOP)$(ROOT)contrib/hbqt/qtnetwork/filelist.mk + include $(TOP)$(ROOT)contrib/hbqt/moc.mk include $(TOP)$(ROOT)config/header.mk include $(TOP)$(ROOT)config/lib.mk else