Quantcast

CMake is unable to find QtCore!

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

CMake is unable to find QtCore!

Toronto Andrew
I get the following errors when trying to build my Qt project:

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:595 (MESSAGE):
  Could NOT find QtCore.  Check

And I need to manually point the CMake gui in the direction of qmake.exe; additionally, I receive these flags: QT_QTCORE_LIBRARY_DEBUG-NOTFOUND, QT_QTCORE_LIBRARY_RELEASE-NOTFOUND and QT_MKSPECS_DIR-NOTFOUND, and I  am unsure about how to get FindQt4.cmake to work properly.

Thanks in advance!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CMake is unable to find QtCore!

John Drescher-2
On Sun, Aug 12, 2012 at 10:30 AM, Toronto Andrew
<[hidden email]> wrote:

> I get the following errors when trying to build my Qt project:
>
> CMake Error at C:/Program Files (x86)/CMake
> 2.8/share/cmake-2.8/Modules/FindQt4.cmake:595 (MESSAGE):
>   Could NOT find QtCore.  Check
>
> And I need to manually point the CMake gui in the direction of qmake.exe;
> additionally, I receive these flags: QT_QTCORE_LIBRARY_DEBUG-NOTFOUND,
> QT_QTCORE_LIBRARY_RELEASE-NOTFOUND and QT_MKSPECS_DIR-NOTFOUND, and I  am
> unsure about how to get FindQt4.cmake to work properly.
>
> Thanks in advance!
>

Did you point cmake-gui to the location of qmake?

John
--

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
|  
Report Content as Inappropriate

Re: CMake is unable to find QtCore!

John Drescher-2
On Sun, Aug 12, 2012 at 10:33 AM, John Drescher <[hidden email]> wrote:

> On Sun, Aug 12, 2012 at 10:30 AM, Toronto Andrew
> <[hidden email]> wrote:
>> I get the following errors when trying to build my Qt project:
>>
>> CMake Error at C:/Program Files (x86)/CMake
>> 2.8/share/cmake-2.8/Modules/FindQt4.cmake:595 (MESSAGE):
>>   Could NOT find QtCore.  Check
>>
>> And I need to manually point the CMake gui in the direction of qmake.exe;
>> additionally, I receive these flags: QT_QTCORE_LIBRARY_DEBUG-NOTFOUND,
>> QT_QTCORE_LIBRARY_RELEASE-NOTFOUND and QT_MKSPECS_DIR-NOTFOUND, and I  am
>> unsure about how to get FindQt4.cmake to work properly.
>>
>> Thanks in advance!
>>
>
> Did you point cmake-gui to the location of qmake?

Are all the Qt dlls in the same folder as qmake.exe? This should be
the bin folder inside of the Qt build.

--
John M. Drescher
--

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
|  
Report Content as Inappropriate

Re: CMake is unable to find QtCore!

Toronto Andrew
Yes to both John, I did point the CMake gui to the position of the qmake.exe within the bin, and it does come with whatever DLLs the source comes with.

I am using Qt 4.8.0 and the latest CMake gui for Windows (x86).

Some other things to get out of the way:
QTDIR is set to C:/Qt/4.8.0/bin, and this directory has been added to the list of PATH variables...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CMake is unable to find QtCore!

Clinton Stimpson
Did you make the mistake of relocating your Qt installation?
You could run qmake -query to see the paths it prints out, to make sure it matches your installation.

Clint

On Aug 12, 2012, at 12:59 PM, Toronto Andrew wrote:

> Yes to both John, I did point the CMake gui to the position of the qmake.exe
> within the bin, and it does come with whatever DLLs the source comes with.
>
> I am using Qt 4.8.0 and the latest CMake gui for Windows (x86).
>
> Some other things to get out of the way:
> QTDIR is set to C:/Qt/4.8.0/bin, and this directory has been added to the
> list of PATH variables...
>
>
>
> --
> View this message in context: http://cmake.3232098.n2.nabble.com/CMake-is-unable-to-find-QtCore-tp7581149p7581154.html
> Sent from the CMake mailing list archive at Nabble.com.
> --
>
> 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
|  
Report Content as Inappropriate

Re: CMake is unable to find QtCore!

Toronto Andrew
Haha spot on mate.

I did so. To rectify, I reinstalled VTK and CMake, fixed the PATH var and the QTDIR. FindQt4 now actually finds 4.8.2 as opposed to 4.8.0, however some flags like QT_USE_FILE and QT_QTGUI_LIBRARY seem to still point at 4.8.0 prompting some linker issues during the build.

Error Log

Just for reference, the CMakeLists is found here if need be.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CMake is unable to find QtCore!

Andreas Pakulat-2
Hi,

On Mon, Aug 13, 2012 at 4:16 PM, Toronto Andrew
<[hidden email]> wrote:
> Haha spot on mate.
>
> I did so. To rectify, I reinstalled VTK and CMake, fixed the PATH var and
> the QTDIR.

Relocating Qt requires either patching the qmake binary or installing
a qt.conf file to help qmake find the libs in the new position. The
absolute include/lib dirs are hardcoded into qmake when its being
built. See http://doc.qt.nokia.com/4.7/qt-conf.html for the
file-format

> FindQt4 now actually finds 4.8.2 as opposed to 4.8.0, however
> some flags like QT_USE_FILE and QT_QTGUI_LIBRARY seem to still point at
> 4.8.0 prompting some linker issues during the build.

Does that mean you didn't move Qt this time?

> http://cmake.3232098.n2.nabble.com/file/n7581165/8Mj17.png
>
> Just for reference, the CMakeLists is found  http://pastie.org/4466367 here
> if need be.

Did you start with a clean cache? The screenshot suggests you're
trying to mix debug and release Qt libraries, thats a very bad idea
anyways (QtOpenGLdd and QtGui4 are mentioned). So maybe things are
still not picked up as you think they are? The cache-file should have
more information.

And you should get rid of LINK_DIRECTORIES, thats not a good idea and
almost always the wrong fix to whatever linking problems you have.
CMake find-modules are supposed to setup the absolute path to
libraries in the variables they 'export', which can be used with
target_link_libraries directly. Same goes for the 'link_libraries'
call for MacOSX I'd say.

Andreas
--

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
|  
Report Content as Inappropriate

Re: CMake is unable to find QtCore!

Toronto Andrew
This post was updated on .
Andreas Pakulat-2 wrote
Hi,

Relocating Qt requires either patching the qmake binary or installing
a qt.conf file to help qmake find the libs in the new position. The
absolute include/lib dirs are hardcoded into qmake when its being
built. See http://doc.qt.nokia.com/4.7/qt-conf.html for the
file-format
-> First off, I really appreciate you looking at my build errors.

Patching the qmake binary? I reinstalled the 4.8.2 binary, why is this not enough? Of course, I will write a qt-conf file I am unable to correct my building environment.


Andreas Pakulat-2 wrote
> FindQt4 now actually finds 4.8.2 as opposed to 4.8.0, however
> some flags like QT_USE_FILE and QT_QTGUI_LIBRARY seem to still point at
> 4.8.0 prompting some linker issues during the build.

Does that mean you didn't move Qt this time?
-> Well, I have both Qt versions withing the same directory (C:/Qt/4.8.0 as well as C:/Qt/4.8.2), and while qmake seems to be configured properly for 4.8.2, I feel like it is the flags I mentioned earlier that point at 4.8.0, however, I could be mistaken.

> http://cmake.3232098.n2.nabble.com/file/n7581165/8Mj17.png
>
> Just for reference, the CMakeLists is found  http://pastie.org/4466367 here
> if need be.

Andreas Pakulat-2 wrote
Did you start with a clean cache? The screenshot suggests you're
trying to mix debug and release Qt libraries, thats a very bad idea
anyways (QtOpenGLdd and QtGui4 are mentioned). So maybe things are
still not picked up as you think they are? The cache-file should have
more information.

And you should get rid of LINK_DIRECTORIES, thats not a good idea and
almost always the wrong fix to whatever linking problems you have.
CMake find-modules are supposed to setup the absolute path to
libraries in the variables they 'export', which can be used with
target_link_libraries directly. Same goes for the 'link_libraries'
call for MacOSX I'd say.

Andreas
I did start with a clean cache. I see what is happening with the debug/release libraries, but do you know what might have caused this? There is nothing in the CMakeLists file that seems like it may be causing it. Could it be a way the other libraries are built (VTK ?)

I will avoid using LINK_DIRECTORIES and optimize the CMakeLists file, will post back if there is progress.  

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: CMake is unable to find QtCore!

Andreas Pakulat-2
Hi,

On Mon, Aug 13, 2012 at 9:40 PM, Toronto Andrew
<[hidden email]> wrote:

>
> Andreas Pakulat-2 wrote
>>
>> Relocating Qt requires either patching the qmake binary or installing
>> a qt.conf file to help qmake find the libs in the new position. The
>> absolute include/lib dirs are hardcoded into qmake when its being
>> built. See http://doc.qt.nokia.com/4.7/qt-conf.html for the
>> file-format
>>
>> -> *First off, I really appreciate you looking at my build errors.
>>
>> Patching the qmake binary? I reinstalled the 4.8.2 binary, why is this not
>> enough?

Well, patching the qmake binary is exactly what happens when you use
Nokia's binary installer for Qt and it patches qmake to the install
location you chose during the installation. The patching/qt.conf file
is only necessary if you then move Qt again to another location.

>>> FindQt4 now actually finds 4.8.2 as opposed to 4.8.0, however
>>> some flags like QT_USE_FILE and QT_QTGUI_LIBRARY seem to still point at
>>> 4.8.0 prompting some linker issues during the build.
>>
>> Does that mean you didn't move Qt this time?
>>
>> -> *Well, I have both Qt versions withing the same directory (C:/Qt/4.8.0
>> as well as C:/Qt/4.8.2), and while qmake seems to be configured properly
>> for 4.8.2, I feel like it is the flags I mentioned earlier that point at
>> 4.8.0, however, I could be mistaken.

You can actually find out how cmake gets qt libs etc. from qmake:

qmake -query

produces a list of paths. CMake will use these with
find_library/find_file and prefers them over the standard lookup paths
of those functions (by using them as HINTS). So if qmake produced
QT_INSTALL_LIBS:C:\Qt\4.8.2 then CMake should find all Qt libraries in
that location.

>>> Just for reference, the CMakeLists is found  http://pastie.org/4466367
>>> here
>>> if need be.
>>
>> Did you start with a clean cache? The screenshot suggests you're
>> trying to mix debug and release Qt libraries, thats a very bad idea
>> anyways (QtOpenGLdd and QtGui4 are mentioned). So maybe things are
>> still not picked up as you think they are? The cache-file should have
>> more information.
>>
>> And you should get rid of LINK_DIRECTORIES, thats not a good idea and
>> almost always the wrong fix to whatever linking problems you have.
>> CMake find-modules are supposed to setup the absolute path to
>> libraries in the variables they 'export', which can be used with
>> target_link_libraries directly. Same goes for the 'link_libraries'
>> call for MacOSX I'd say.
>>
>> Andreas
>>
>> *I did start with a clean cache. I see what is happening with the
>> debug/release libraries, but do you know what might have caused this?

Not without seeing the cmake cache or some output what the various
cmake variables you're using actually contain.

>> There is nothing in the CMakeLists file that seems like it may be causing
>> it. Could it be a way the other libraries are built (VTK ?)

Could be, if the other cmake variables contain Qt debug libs, since
you use them with link_directories and link_libraries they could
influence the sample-target.

Andreas
--

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
Loading...