[CMake] FindQt4.cmake can't find Qt4 although it find the right qmake.

kmorel kmorel at sandia.gov
Thu Aug 24 14:01:43 EDT 2006


You need to include the QT_USE_FILE.

FIND_PACKAGE(Qt4)
# Set appropriate QT_USE_* variables here.
INCLUDE(${QT_USE_FILE})

-Ken

On 8/24/06 8:37 AM, "Antoine Tollenaere" <atollena at gmail.com> wrote:

> Hi,
> 
> I'm running through a strange error when trying to find Qt4 with CMake.
> I include the following lines in my CMakeLists.txt:
> 
> FIND_PACKAGE(Qt4)
> MESSAGE(STATUS "${qt4_include_dir}")
> MESSAGE(STATUS "${QT_USE_FRAMEWORKS}")
> MESSAGE(STATUS "${QT_QTCORE_INCLUDE_DIR}")
> MESSAGE(STATUS "${QT_INCLUDE_DIR}")
> MESSAGE(STATUS "${QT_FOUND}")
> 
> And here is the output when I run CMake in this directory:
> 
> -- C:/Qt/4.1.4/include
> --
> -- C:/Qt/4.1.4/include/QtCore
> -- QT_INCLUDE_DIR-NOTFOUND
> -- NO
> 
> This is really strange, because everything seems to be found, only the
> last variables are not set properly.
> Just to avoid you travelling your whole tree I put the piece of code
> from FindQt4.cmake that really makes me wonder why these variables are
> not set properly:
> 
>  IF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
>     IF (QT_USE_FRAMEWORKS)
>       SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
>     ELSE (QT_USE_FRAMEWORKS)
> 
>       STRING( REGEX REPLACE "/QtCore$" "" qt4_include_dir
> ${QT_QTCORE_INCLUDE_DIR})
>       SET( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "")
>     ENDIF (QT_USE_FRAMEWORKS)
>   ENDIF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
> 
> It works fine on Linux with the same version of CMake distribution.
> Does anyone have an idea of where this problem could come from ?
> 
> Regards,




More information about the CMake mailing list