c++ - Cmake cannot find QGLWidget -
i have simple bouncing ball program wrote in qtcreator on windows couple years ago, , i'm trying rebuild on linux (ubuntu 14.04) using cmakelists instead of qt project files. cmakelists.txt file (loosely based off cmake file in this question below.
cmake_minimum_required ( version 2.6 ) project ( bouncyball ) find_package ( qt4 components qtgui qtopengl required ) set (qt_use_qtopengl true) include(${qt_use_file}) add_definitions(${qt_definitions}) include_directories( ${qt_qtopengl_include_dir} ${opengl_include_dir} ) find_package ( bullet required ) add_executable ( bouncyball main.cpp bouncyball.cpp bulletwidget.cpp ) target_link_libraries( bouncyball ${qt_libraries} ${bullet_libraries} )
cmake configures , generates build files without errors, fails compile following error:
[ 33%] building cxx object cmakefiles/bouncyball.dir/main.cpp.o /usr/bin/c++ -dqt_gui_lib -dqt_no_debug -dqt_opengl_lib -isystem /usr/include/qt4 -isystem /usr/include/qt4/qtopengl -isystem /usr/include/qt4/qtgui -i/home/user/programs/buildarea/games/bouncyball -o cmakefiles/bouncyball.dir/main.cpp.o -c /home/user/programs/games/bouncyball/main.cpp in file included /home/user/programs/games/bouncyball/main.cpp:2:0: /home/user/programs/games/bouncyball/bulletwidget.h:4:30: fatal error: qtopengl/qglwidget: no such file or directory #include <qtopengl/qglwidget>
i've verified file indeed in /usr/include/qt4/qtopengl. i've looked online, solutions i've found refer adding qt += opengl
project file (but i'm using cmake) or not having dev-tools or qt-sdk packages installed (which have).
what missing?
isn't there typo in code 'qtopengl/qglwidget'? qtopengl should changed qtopengl. if on linux case matters.