[CMake] cmake failing to find QApplication header

Manuel Klimek klimek at box4.net
Fri Nov 16 15:48:05 EST 2007


Hi,

have you tried using ${QT_INCLUDE_DIR} and <QtGui/QApplication>?

Manuel

On Nov 16, 2007 8:37 PM, Stephen Collyer <scollyer at netspinner.co.uk> wrote:
> I have a top level CMakeList.txt file containing:
>
> FIND_PACKAGE(Qt4 REQUIRED)
> .
> .
> INCLUDE_DIRECTORIES(${QT_QTCORE_INCLUDE_DIR})
> INCLUDE_DIRECTORIES(${QT_QTGUI_INCLUDE_DIR})
> INCLUDE_DIRECTORIES(${QT_QTNETWORK_INCLUDE_DIR})
> INCLUDE_DIRECTORIES(${QT_QTSQL_INCLUDE_DIR})
>
> and I've tried to build the Hello World example from the
> Qt tutorial which looks like this:
>
> #include <QApplication>
> #include <QPushButton>
>
> int main(int argc, char *argv[])
> {
>     QApplication app(argc, argv);
>
>     QPushButton hello("Hello world!");
>     hello.resize(100, 30);
>
>     hello.show();
>     return app.exec();
> }
>
> and "make all" complains with errors of this nature:
>
> <somedire>/src/exe/qt_test.cpp:1:24: error: QApplication: No such file
> or directory
>
> which seems to indicate some failure of the -I generation.
> I can't think what else I need to do though. The various
> ${QT_.._INCLUDE_DIR} variables seems to be correctly defined.
>
> Any hints ?
>
> --
> Regards
>
> Steve Collyer
> Netspinner Ltd
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
http://klimek.box4.net


More information about the CMake mailing list