[CMake] Moving QT getting FIND_PACKAGE( Qt4 ) to work

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Apr 27 19:21:26 EDT 2009


On 2009-04-28 01:01+0200 Andreas Pakulat wrote:

> On 27.04.09 14:50:47, Alan W. Irwin wrote:
>> On 2009-04-27 18:47+0200 Anders Backman wrote:
>>> I have a problem where I pack the necessary stuff from qt into a dependency
>>> zip file (.h, .lib, .dll and qmake.exe).
>>>
>>> I have the path to qmake setup, so that qmake can be found.
>>>
>>> Then I unpack that to some specified directory and run cmake on my own code.
>>>
>>> My projectgs CMakeLists.txt call FIND_PACKAGE( Qt4 ) which among other
>>> things call:
>>>
>>> qmake -query QT_INSTALL_LIBS (
>>>
>>> Now this returns with the ORIGINAL build directory, not the new one where
>>> qmake actually exists.
>>
>> You have gotten a lot of answers, but I think they are too complicated. I am
>> a Qt newbie, but what works for me under Linux is simply to adjust the PATH
>> so that the "qmake" command refers to the version that I want.  I don't know
>> why your PATH adjustment did not work, but it certainly works for me.  The
>> PATH adjustment must be done, of course, before building a Qt dependent
>> project (PLplot in this case) in an initially empty build tree.  For
>> example:
>>
>> PATH='/home/software/qtsdk-2009.02/qt/bin:'$PATH
>
> The sdk is relocateable, it adjusts the internal paths. Try moving the
> sdk folder to somewhere else after installation and then run qmake.
> Thats the problem that Anders has [...].

I understand why moving the sdk around after you have unpacked it to a
specific location would screw things up.  That's true of lots of software.
So then my advice would be to simplify your life by not moving the sdk from
your initial choice of the install location.  However, if you must change
your mind about where you install it (or you are on an OS that doesn't allow
you an initial choice), then follow all the other advice here.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list