[CMake] Trouble with non standard Qt installation.

Clinton Stimpson clinton at elemtech.com
Mon Nov 29 15:01:04 EST 2010


On Monday, November 29, 2010 12:26:20 pm tibur wrote:
> Le 29/11/2010 15:08, Clinton Stimpson a écrit :
> > On Monday, November 29, 2010 11:46:52 am John Drescher wrote:
> >> On Mon, Nov 29, 2010 at 1:42 PM, John Drescher<drescherjm at gmail.com>  
wrote:
> >>> On Mon, Nov 29, 2010 at 1:35 PM, tibur<tiburtibur at gmail.com>  wrote:
> >>>> Hello.
> >>>> 
> >>>> Our team uses the same Windows (VS) Qt build, but all the developers
> >>>> don't store it at the same place on their hard drive. So qmake.exe
> >>>> doesn't contain the good include, library, ... directories.
> >>>> 
> >>>> On the FindQt4.cmake script of version 2.8.2 (line 770), the
> >>>> find_library call was using QT_LIBRARY_DIR variable to find the
> >>>> possible location of QtCore.lib, ...
> >>>> 
> >>>> But on version 2.8.3, this module now queries qmake.exe to retrieve
> >>>> the library and includes path. This stuck us to the 2.8.2 version of
> >>>> CMake, since qmake doesn't return the good directories.
> >>>> 
> >>>> How can we fix that?
> >>> 
> >>> I am confused on what you are trying to fix.
> >> 
> >> Oh. I see now. I think you need to have each developer build Qt on
> >> their system.
> > 
> > You could also look at the Qt installer from Nokia.  They use a little
> > tool to modify the binaries to work correctly where they are installed.
> > 
> > FindQt4.cmake has always queried qmake.exe.  So I'm wondering how you
> > made it work with cmake 2.8.2.  Did you manually set some variables
> > first?
> > 
> > And are you also aware that QtCore.dll has these same paths embedded that
> > one finds from qmake.exe?  Unless you use a qt.conf file or something,
> > you're left with a crippled installation.
> 
> Before calling FindQt4, we did set the following variables:
> QT_QMAKE_EXECUTABLE
> QT_BINARY_DIR
> QT_LIBRARY_DIR
> QT_HEADERS_DIR
> 
> We could rebuild Qt or change the names directly inside qmake.exe (why
> the hell did they hard coded those path?). But we would prefer to stick
> to the current behavior for our developers: checkout the source tree,
> checkout the third party tree, and compile...
> I was wondering if there is an easy way to bypass qmake with the current
> implementation of FindQt4, or do we have to customize that module.

Another way to to do this is to put an empty qt.conf file in the bin/ directory 
of your Qt installation that you can also check into your source repository.  
With that approach, you can also remove setting of extra QT_* variables before 
running cmake.

> 
> Why is QtCore.dll using those path? We never had problems with that. Is
> it to retrieve the plugin's path?

Its to support the QLibraryInfo class, which is used is also used by qmake and 
loading of Qt plugins.  As the docs say there, you can make a qt.conf file to 
override this.  If you have problems with the Qt libraires using QLibraryInfo, 
you can also put a qt.conf file (specifying the Qt install prefix) in the build 
directory of your application.

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com


More information about the CMake mailing list