MantisBT - CMake
View Issue Details
0013886CMakeModulespublic2013-02-01 12:492016-06-10 14:31
David Cournapeau 
Kitware Robot 
normalminoralways
closedmoved 
Mac OS XMac OS X10.7
CMake 2.8.10.1 
 
0013886: FindQt4.cmake should not look into cmake default path when querying qmake
In FindQt4.cmake, line 644, I see:

  find_path(QT_QTCORE_INCLUDE_DIR QtCore
                HINTS ${qt_headers} ${QT_LIBRARY_DIR}
                PATH_SUFFIXES QtCore qt4/QtCore
        )

where qt_headers is queried from qmake a few lines before. When you have a custom built qt AND the official qt, QT_QTCORE_INCLUDE_DIR will be set to the official qt SDK, even if the custom built qt's qmake is the first one on the PATH.

This gives confusing compilation errors as one gets a mix of include paths from the official sdk and library links from the custom built qt.

I could workaround with the following:

    find_path(QT_QTCORE_INCLUDE_DIR QtCore
                HINTS ${qt_headers} ${QT_LIBRARY_DIR}
                PATH_SUFFIXES QtCore qt4/QtCore
                NO_CMAKE_SYSTEM_PATH
        )

Not using NO_CMAKE_SYSTEM_PATH would make sense in every case as long as one rely solely on qmake to get variables. If one wants to support looking for sdk without qmake, one may want to use two different codepaths (when qmake is found vs not found).
No tags attached.
Issue History
2013-02-01 12:49David CournapeauNew Issue
2013-02-01 12:55Clinton StimpsonNote Added: 0032186
2016-06-10 14:28Kitware RobotNote Added: 0042214
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0032186)
Clinton Stimpson   
2013-02-01 12:55   
It is that way to support cross compiling.

The tools, moc, uic, qmake, etc... are found in the native bin directory, but the includes and libraries can come from another Qt installation.

HINTS comes before CMAKE_SYSTEM_PATH, so your problem is that the
"HINTS ${qt_headers} ${QT_LIBRARY_DIR} "
part is not working. Can you debug it to find out why?
(0042214)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.