CMake can't find the correct Qt installation paths

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

CMake can't find the correct Qt installation paths

norulez
Hello,

when I install Qt to the location C:\Qt\QtSDK and then I run cmake, everything is working fine.
But if I rename the directory to C:\Qt\QtSDL then cmake have problems to find Qt because qmake.exe isn't patched.

In qmake.exe the path to the libraries are set to "C:\Qt\QtSDK\..." which is also used for the query command.

So, if i patch qmake.exe (Rename the directory in the qmake.exe file => works only if the length of the directory name is the same),
cmake works fine but the problem is, that cmake tries to find out the location of libraries and so on from the query, which is wrong in my oppinion,
because if I want to move the custom build Qt library to another location then cmake doesn't find Qt.

For example when I rename the directory to C:\Qt\QtSDL and run qmake -query:
QT_INSTALL_PREFIX:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw
QT_INSTALL_DATA:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\
QT_INSTALL_DOCS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\doc
QT_INSTALL_HEADERS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\include
QT_INSTALL_LIBS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\lib
QT_INSTALL_BINS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\bin
QT_INSTALL_PLUGINS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\plugins
QT_INSTALL_IMPORTS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\imports
QT_INSTALL_TRANSLATIONS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\translations
QT_INSTALL_CONFIGURATION:C:/Qt/QtSDK/Desktop/Qt/4.8.1/mingw
QT_INSTALL_EXAMPLES:C:\Qt\QtSDK\Examples\4.7
QT_INSTALL_DEMOS:C:\Qt\QtSDK\Demos\4.7
QMAKE_MKSPECS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\\mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.8.1

When I run it from the drive letter D:, E:, F:, ..., then the result is the same.

Best Regards
NoRulez

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMake can't find the correct Qt installation paths

Michael Jackson
Don't rename the Qt installation path after you install Qt. This is a well known way to have problems. If you want Qt in C:/Qt/QtSDL then INSTALL it in that path or build it in that path.
  There are various ways to mess around with a qt.conf file that may help out but the path to the Qt installation is hard coded in ALL the qt libraries and executables.

  Just a piece of advice from the trenches.
--
Mike Jackson <www.bluequartz.net>

On Sep 7, 2012, at 7:37 AM, NoRulez wrote:

> Hello,
>
> when I install Qt to the location C:\Qt\QtSDK and then I run cmake, everything is working fine.
> But if I rename the directory to C:\Qt\QtSDL then cmake have problems to find Qt because qmake.exe isn't patched.
>
> In qmake.exe the path to the libraries are set to "C:\Qt\QtSDK\..." which is also used for the query command.
>
> So, if i patch qmake.exe (Rename the directory in the qmake.exe file => works only if the length of the directory name is the same),
> cmake works fine but the problem is, that cmake tries to find out the location of libraries and so on from the query, which is wrong in my oppinion,
> because if I want to move the custom build Qt library to another location then cmake doesn't find Qt.
>
> For example when I rename the directory to C:\Qt\QtSDL and run qmake -query:
> QT_INSTALL_PREFIX:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw
> QT_INSTALL_DATA:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\
> QT_INSTALL_DOCS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\doc
> QT_INSTALL_HEADERS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\include
> QT_INSTALL_LIBS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\lib
> QT_INSTALL_BINS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\bin
> QT_INSTALL_PLUGINS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\plugins
> QT_INSTALL_IMPORTS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\imports
> QT_INSTALL_TRANSLATIONS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\translations
> QT_INSTALL_CONFIGURATION:C:/Qt/QtSDK/Desktop/Qt/4.8.1/mingw
> QT_INSTALL_EXAMPLES:C:\Qt\QtSDK\Examples\4.7
> QT_INSTALL_DEMOS:C:\Qt\QtSDK\Demos\4.7
> QMAKE_MKSPECS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\\mkspecs
> QMAKE_VERSION:2.01a
> QT_VERSION:4.8.1
>
> When I run it from the drive letter D:, E:, F:, ..., then the result is the same.
>
> Best Regards
> NoRulez
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMake can't find the correct Qt installation paths

Andreas Pakulat-2
In reply to this post by norulez
Hi,

as Michael said, don't move Qt around.

In fact Qt itself does not support this at all, so a Qt installation
that is moved after the install process and without re-running the
patching or a writing a qt.conf file is to be considered a broken Qt
installation. It'll also not find plugins etc. itself either.

Andreas

On Fri, Sep 7, 2012 at 1:37 PM, NoRulez <[hidden email]> wrote:

> Hello,
>
> when I install Qt to the location C:\Qt\QtSDK and then I run cmake,
> everything is working fine.
> But if I rename the directory to C:\Qt\QtSDL then cmake have problems to
> find Qt because qmake.exe isn't patched.
>
> In qmake.exe the path to the libraries are set to "C:\Qt\QtSDK\..." which is
> also used for the query command.
>
> So, if i patch qmake.exe (Rename the directory in the qmake.exe file =>
> works only if the length of the directory name is the same),
> cmake works fine but the problem is, that cmake tries to find out the
> location of libraries and so on from the query, which is wrong in my
> oppinion,
> because if I want to move the custom build Qt library to another location
> then cmake doesn't find Qt.
>
> For example when I rename the directory to C:\Qt\QtSDL and run qmake -query:
> QT_INSTALL_PREFIX:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw
> QT_INSTALL_DATA:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\
> QT_INSTALL_DOCS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\doc
> QT_INSTALL_HEADERS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\include
> QT_INSTALL_LIBS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\lib
> QT_INSTALL_BINS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\bin
> QT_INSTALL_PLUGINS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\plugins
> QT_INSTALL_IMPORTS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\imports
> QT_INSTALL_TRANSLATIONS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\translations
> QT_INSTALL_CONFIGURATION:C:/Qt/QtSDK/Desktop/Qt/4.8.1/mingw
> QT_INSTALL_EXAMPLES:C:\Qt\QtSDK\Examples\4.7
> QT_INSTALL_DEMOS:C:\Qt\QtSDK\Demos\4.7
> QMAKE_MKSPECS:C:\Qt\QtSDK\Desktop\Qt\4.8.1\mingw\\mkspecs
> QMAKE_VERSION:2.01a
> QT_VERSION:4.8.1
>
> When I run it from the drive letter D:, E:, F:, ..., then the result is the
> same.
>
> Best Regards
> NoRulez
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake