Difference between qt4-mac and official Nokia-package

Michael Dickens michaelld at macports.org
Wed Sep 8 11:00:11 PDT 2010


On Sep 8, 2010, at 1:18 PM, Ryan Schmidt wrote:

  On Sep 8, 2010, at 11:59, Jan Lübke wrote:

  I assume that qt4-mac is basically the same. Only the paths
  are different. Is that assumption correct?

  I hope so, but do not know.


For all practical purposes, yes, they are the same.  They provide
the same headers and the libraries contain the same
externally-available classes, functions, and variables.

  Of course I can not expect you to know harbour. It has a very
  sophisticated build tool that works on many different
  platforms. It does not auto-detect the presence of qt4. But
  managed to tweak it and now it tries to build with qt-support.

  My problem (besides the lack of knowledge about qt, make and
  macports ;-) ) is, that some files do not get found during
  build. Especially "QtCore/qglobal.h". In macports, there is a
  file
  in "/opt/local/libexec/qt4-mac/lib/QtCore.framework/Versions/4
  /Headers/qglobal.h". So I edited the source of harbour to use
  that file. But here comes the next problem. Even "qglobal.h"
  contains a link to "QtCore/qconfig.h", a file, that does not
  exist. However, there is a file
  called  "/opt/local/libexec/qt4-mac/lib/QtCore.framework/Versi
  ons/4/Headers/qconfig.h"

  QtCore is built as a Mac OS X framework. Mac OS X's compiler
  knows that when you include "QtCore/qconfig.h" it will look
  for a framework called QtCore.framework, in its
  Headers directory, for the qconfig.h file. So all that should
  need to happen is that you tell your build process where the
  framework is located.  I believe you do that using the
  compiler argument "-F/opt/local/libexec/qt4-mac/lib". You
  may also need to use the argument "-framework QtCore", I'm not
  sure.


The best way to do this is to use PKGCONFIG for "QtCore" -- it
will return back what you need (CFLAGS and LDFLAGS).
Alternatively, if you're using MacPorts' provided qt4-mac, you
probably want to include "-I${prefix}/libexec/qt4-mac/include"
for headers and "-F${prefix}/libexec/qt4-mac/lib" for frameworks
(if installed as frameworks), and
"-L${prefix}/libexec/qt4-mac/lib" for libraries (in no installed
as frameworks).  Headers can be found in both the frameworks as
well as the top-level (to qt4) include directory (via a soft link
to the framework's headers).

  The maintainer of qt4-mac recently stated he wants to remove
  the framework build. If he does, then these steps won't be
  necessary, and you'd instead add the path to the headers and
  libraries in -I and -L arguments, respectively.


Just use the PKGCONFIG file and all will be well, no matter if Qt
was installed as a framework or not.  I've been testing out the
no_framework variety and it works just fine with a host of other
ports include py26-pyqt4, qwt, qwtplot3d, and GNU Radio's qtgui
with no changes to those Portfiles -- because they use PKGCONFIG
to find Qt.  As Qt has been around a long time, and has used
PKGCONFIG for most of that time, I think most folks use PKGCONFIG
to find the Qt installed files.  Thus, IMHO it's the best way to
go.

Hope this helps. - MLD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20100908/9c50b4a1/attachment.html>


More information about the macports-users mailing list